任何人可以帮助我,为什么我不能够加载特定的动作特定布局与我无法加载布局,而在轨渲染
render :layout => "application"
application.html.erb目前在布局夹。 是我必须做一些布局设置?
我的代码是: -
class PageController < ApplicationController
layout false
def index1
render :layout => "application"
end
end
请更好地解释错误,因为这应该起作用。你是否遇到错误,或者只是渲染没有布局? – Fallenhero
@Fallenhero,它只是渲染没有布局。我不承认为什么。我的布局出现在布局文件夹中。我有这个谷歌,但没有找到任何答案。所以请帮助我为什么这个(render:layout =>“application”)不起作用。是我必须做一些设置? –
@Fallenhero,其实我想添加特定的CSS与特定的布局。我在视图页面中使用了content_for,并在布局中输出其名称。我不明白它不从选择布局中的链接呈现CSS,或者不选择布局 –