非常感谢您的帮助。在一个布局中显示多个视图(Rails)
我正在研究一个简单版本的Groupon's(www.Groupon.com)“通过电子邮件获得优惠”。 当您点击网站顶部的“通过电子邮件获得优惠”时,您可以通过简单的表格填写并获得Groupon优惠邮件。
我的搜索有点不同,我把它作为一个资源,所以我可以将电子邮件和用户位置存储在数据库中供以后使用。
在我的布局上,我根据需要正确地使用其他资源,并且工作正常。但是我想让布局对我的简单电子邮件请求资源“收益”,因此它总是位于顶部(隐藏或由JavaScript显示)。
我知道这可能不是Rails的方式。请让我知道你在想什么。
谢谢你的帮助。
这里是一些代码: 只是总结一下,我想要做的是在控制器(simplealert)的新动作中显示一个_form.html.erb视图在我的布局标题中,以及其他任何我正在在身体里。代码示例波纹管。
<header>here is my problem. I want to load a _form.html.erb from my Simple_alert new method. Of course I want it to save properly as well. This will be similar to the "Get Deal by mail" from groupon.com sometimes I hide and show it. But it is a resource with proper DB fields.
</header>
body>
<%= yield %> # Here I normally yield for whatever is the main user call. This works fine.
混帐这一点,你github上 – s84 2011-03-04 02:19:43
“在我的布局我正确我的其他资源”是什么意思呢? – s84 2011-03-04 02:22:11
这真的很难回答。我建议你发布很多代码,我大概可以弄明白。 – s84 2011-03-04 02:24:27