只是搞乱轨道布局。阅读guide 2.2.11.2:布局选项Rails 4如何在视图中使用渲染布局选项?
创建一个名为two_column_landing的简单布局,并将其放置在app/views下的layouts目录中。
然后修改了我的观点来呈现的布局:
<h1>Ca#tcl</h1>
<p>Find me in app/views/ca/tcl.html.erb</p>
<%= render layout: "two_column_landing" %>
我得到这个错误:
You invoked render but did not give any of :partial, :template, :inline, :file or :text option.
我知道这可能不是一个伟大的事情做在一个习惯生产代码,但我只是想出如何做我想要的。任何想法为什么这不起作用?这不是导轨4的特点吗?
是否在app/views/layouts /文件夹中放置了'two_column_landing.html.erb'文件? – jimagic