aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/render/rendering.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/render/rendering.rb')
-rw-r--r--actionpack/lib/action_view/render/rendering.rb20
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)