mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Template rendering should include layout time.
This commit is contained in:
parent
6487d2871c
commit
a5a9156b4e
1 changed files with 12 additions and 12 deletions
|
@ -93,19 +93,19 @@ module ActionView
|
||||||
def _render_template(template, layout = nil, options = {})
|
def _render_template(template, layout = nil, options = {})
|
||||||
locals = options[:locals] || {}
|
locals = options[:locals] || {}
|
||||||
|
|
||||||
content = ActiveSupport::Notifications.instrument("action_view.render_template",
|
ActiveSupport::Notifications.instrument("action_view.render_template",
|
||||||
:identifier => template.identifier, :layout => (layout ? layout.identifier : nil)) do
|
:identifier => template.identifier, :layout => layout.try(:identifier)) do
|
||||||
template.render(self, locals)
|
|
||||||
|
content = template.render(self, locals)
|
||||||
|
@_content_for[:layout] = content
|
||||||
|
|
||||||
|
if layout
|
||||||
|
@_layout = layout.identifier
|
||||||
|
content = _render_layout(layout, locals)
|
||||||
|
end
|
||||||
|
|
||||||
|
content
|
||||||
end
|
end
|
||||||
|
|
||||||
@_content_for[:layout] = content
|
|
||||||
|
|
||||||
if layout
|
|
||||||
@_layout = layout.identifier
|
|
||||||
content = _render_layout(layout, locals)
|
|
||||||
end
|
|
||||||
|
|
||||||
content
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def _render_layout(layout, locals, &block)
|
def _render_layout(layout, locals, &block)
|
||||||
|
|
Loading…
Reference in a new issue