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 = {})
|
||||
locals = options[:locals] || {}
|
||||
|
||||
content = ActiveSupport::Notifications.instrument("action_view.render_template",
|
||||
:identifier => template.identifier, :layout => (layout ? layout.identifier : nil)) do
|
||||
template.render(self, locals)
|
||||
ActiveSupport::Notifications.instrument("action_view.render_template",
|
||||
:identifier => template.identifier, :layout => layout.try(:identifier)) do
|
||||
|
||||
content = template.render(self, locals)
|
||||
@_content_for[:layout] = content
|
||||
|
||||
if layout
|
||||
@_layout = layout.identifier
|
||||
content = _render_layout(layout, locals)
|
||||
end
|
||||
|
||||
content
|
||||
end
|
||||
|
||||
@_content_for[:layout] = content
|
||||
|
||||
if layout
|
||||
@_layout = layout.identifier
|
||||
content = _render_layout(layout, locals)
|
||||
end
|
||||
|
||||
content
|
||||
end
|
||||
|
||||
def _render_layout(layout, locals, &block)
|
||||
|
|
Loading…
Reference in a new issue