aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/renderer/template_renderer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/lib/action_view/renderer/template_renderer.rb')
-rw-r--r--actionview/lib/action_view/renderer/template_renderer.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb
index b2d7332572..da0b2dc0d2 100644
--- a/actionview/lib/action_view/renderer/template_renderer.rb
+++ b/actionview/lib/action_view/renderer/template_renderer.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "active_support/core_ext/object/try"
-
module ActionView
class TemplateRenderer < AbstractRenderer #:nodoc:
def render(context, options)
@@ -54,7 +52,7 @@ module ActionView
# supplied as well.
def render_template(view, template, layout_name, locals)
render_with_layout(view, template, layout_name, locals) do |layout|
- instrument(:template, identifier: template.identifier, layout: layout.try(:virtual_path)) do
+ instrument(:template, identifier: template.identifier, layout: (layout && layout.virtual_path)) do
template.render(view, locals) { |*name| view._layout_for(*name) }
end
end