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.rb24
1 files changed, 17 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb
index c4033fad9e..5e7dd3e2df 100644
--- a/actionpack/lib/action_view/render/rendering.rb
+++ b/actionpack/lib/action_view/render/rendering.rb
@@ -77,16 +77,19 @@ module ActionView
end
def _render_inline(inline, layout, options)
- handler = Template.handler_class_for_extension(options[:type] || "erb")
- template = Template.new(options[:inline], "inline template", handler, {})
+ locals = options[:locals]
- locals = options[:locals]
- content = template.render(self, locals)
+ content = ActiveSupport::Notifications.instrument(:render_inline) do
+ handler = Template.handler_class_for_extension(options[:type] || "erb")
+ template = Template.new(options[:inline], "inline template", handler, {})
+ template.render(self, locals)
+ end
_render_text(content, layout, locals)
end
def _render_text(content, layout, locals)
+ ActiveSupport::Notifications.instrument(:render_text)
content = _render_layout(layout, locals){ content } if layout
content
end
@@ -110,8 +113,13 @@ module ActionView
msg
end
- locals = options[:locals] || {}
- content = partial ? _render_partial_object(template, options) : template.render(self, locals)
+ locals = options[:locals] || {}
+
+ content = ActiveSupport::Notifications.instrument(:render_template,
+ :identifier => template.identifier, :layout => (layout ? layout.identifier : nil)) do
+ partial ? _render_partial_object(template, options) : template.render(self, locals)
+ end
+
@_content_for[:layout] = content
if layout
@@ -124,7 +132,9 @@ module ActionView
end
def _render_layout(layout, locals, &block)
- layout.render(self, locals){ |*name| _layout_for(*name, &block) }
+ ActiveSupport::Notifications.instrument(:render_layout, :identifier => layout.identifier) do
+ layout.render(self, locals){ |*name| _layout_for(*name, &block) }
+ end
end
end
end