Template rendering should include layout time.

This commit is contained in:
José Valim 2010-01-15 12:23:13 +01:00
parent 6487d2871c
commit a5a9156b4e
1 changed files with 12 additions and 12 deletions

View File

@ -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)