diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-15 12:23:13 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-15 12:24:32 +0100 |
commit | a5a9156b4ebab1e0f441b584f86be7380b21353b (patch) | |
tree | e77dac0d6a32aef06f8f4c4c25ee9016b604fd77 /actionpack | |
parent | 6487d2871cbd44d769c483f47130e18d53e6e381 (diff) | |
download | rails-a5a9156b4ebab1e0f441b584f86be7380b21353b.tar.gz rails-a5a9156b4ebab1e0f441b584f86be7380b21353b.tar.bz2 rails-a5a9156b4ebab1e0f441b584f86be7380b21353b.zip |
Template rendering should include layout time.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/render/rendering.rb | 20 |
1 files changed, 10 insertions, 10 deletions
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) |