From a5a9156b4ebab1e0f441b584f86be7380b21353b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 15 Jan 2010 12:23:13 +0100 Subject: Template rendering should include layout time. --- actionpack/lib/action_view/render/rendering.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'actionpack/lib/action_view/render/rendering.rb') diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb index 2fdfad694d..d2f28f7e38 100644 --- a/actionpack/lib/action_view/render/rendering.rb +++ b/actionpack/lib/action_view/render/rendering.rb @@ -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) - end + ActiveSupport::Notifications.instrument("action_view.render_template", + :identifier => template.identifier, :layout => layout.try(:identifier)) do - @_content_for[:layout] = content + content = template.render(self, locals) + @_content_for[:layout] = content - if layout - @_layout = layout.identifier - content = _render_layout(layout, locals) - end + if layout + @_layout = layout.identifier + content = _render_layout(layout, locals) + end - content + content + end end def _render_layout(layout, locals, &block) -- cgit v1.2.3