diff options
Diffstat (limited to 'actionview/lib/action_view/renderer')
-rw-r--r-- | actionview/lib/action_view/renderer/streaming_template_renderer.rb | 2 | ||||
-rw-r--r-- | actionview/lib/action_view/renderer/template_renderer.rb | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/actionview/lib/action_view/renderer/streaming_template_renderer.rb b/actionview/lib/action_view/renderer/streaming_template_renderer.rb index 08a280c7ee..5942717b8d 100644 --- a/actionview/lib/action_view/renderer/streaming_template_renderer.rb +++ b/actionview/lib/action_view/renderer/streaming_template_renderer.rb @@ -62,7 +62,7 @@ module ActionView output = ActionView::StreamingBuffer.new(buffer) yielder = lambda { |*name| view._layout_for(*name) } - instrument(:template, identifier: template.identifier, layout: layout.try(:virtual_path)) do + instrument(:template, identifier: template.identifier, layout: (layout && layout.virtual_path)) do outer_config = I18n.config fiber = Fiber.new do I18n.config = outer_config 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 |