method
_render_with_layout
rails latest stable - Class:
ActionView::Base
_render_with_layout(options, local_assigns, &block)private
No documentation available.
# File actionpack/lib/action_view/base.rb, line 335
def _render_with_layout(options, local_assigns, &block) #:nodoc:
partial_layout = options.delete(:layout)
if block_given?
begin
@_proc_for_layout = block
concat(render(options.merge(:partial => partial_layout)))
ensure
@_proc_for_layout = nil
end
else
begin
original_content_for_layout = @content_for_layout if defined?(@content_for_layout)
@content_for_layout = render(options)
if (options[:inline] || options[:file] || options[:text])
@cached_content_for_layout = @content_for_layout
render(:file => partial_layout, :locals => local_assigns)
else
render(options.merge(:partial => partial_layout))
end
ensure
@content_for_layout = original_content_for_layout
end
end
end