我试图在一个动作中编写渲染,但布局行为不同,为什么?
def show
# assuming we have a partial in app/views/shared/_panel_show.html.erb
#render "shared/_panel_show" # have layout
#render "/shared/_panel_show" # without layout
#render "shared/panel_show" # Template is missing
#render :partial => "shared/panel_show" # without layout
render :partial => "/shared/_panel_show",:layout => "application" # have layout
end
我想渲染部分并遵循控制器布局。