method
render_with_a_layout
v2.1.0 -
Show latest stable
- Class:
ActionController::Layout
render_with_a_layout(options = nil, extra_options = {}, &block)protected
No documentation available.
# File actionpack/lib/action_controller/layout.rb, line 244
def render_with_a_layout(options = nil, extra_options = {}, &block) #:nodoc:
template_with_options = options.is_a?(Hash)
if (layout = pick_layout(template_with_options, options)) && apply_layout?(template_with_options, options)
options = options.merge :layout => false if template_with_options
logger.info("Rendering template within #{layout}") if logger
content_for_layout = render_with_no_layout(options, extra_options, &block)
erase_render_results
add_variables_to_assigns
@template.instance_variable_set("@content_for_layout", content_for_layout)
response.layout = layout
status = template_with_options ? options[:status] : nil
render_for_text(@template.render_file(layout, true), status)
else
render_with_no_layout(options, extra_options, &block)
end
end