呈现布局和视图,rails
Rendering both layout and view, rails
我有下一个错误:Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect
这里
respond_to do |format|
format.html {
render layout:"productView"
render "show2"
}
ajax_respond format, :section_id => "user_tab_comments"
format.js
end
所以我想渲染布局和视图,我做错了什么?
像这样使用而不是双重渲染:
render :show2, layout: 'productView'
布局页面应该在app/views/layouts/下希望它有效。
我有下一个错误:Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect
这里
respond_to do |format|
format.html {
render layout:"productView"
render "show2"
}
ajax_respond format, :section_id => "user_tab_comments"
format.js
end
所以我想渲染布局和视图,我做错了什么?
像这样使用而不是双重渲染:
render :show2, layout: 'productView'
布局页面应该在app/views/layouts/下希望它有效。