Skip to content

Commit 00547aa

Browse files
authored
Merge pull request rails#46298 from Shopify/actionview-jbuilder-compat
Fix Action View compatibility with jbuilder
2 parents b96ddea + 05919b0 commit 00547aa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

actionview/lib/action_view/renderer/abstract_renderer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class RenderedTemplate # :nodoc:
142142
attr_reader :body, :template
143143

144144
def initialize(body, template)
145-
@body = body.to_s
145+
@body = body
146146
@template = template
147147
end
148148

actionview/lib/action_view/template.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def render(view, locals, buffer = nil, add_to_stack: true, &block)
180180
view._run(method_name, self, locals, buffer, add_to_stack: add_to_stack, has_strict_locals: @strict_locals, &block)
181181
nil
182182
else
183-
view._run(method_name, self, locals, OutputBuffer.new, add_to_stack: add_to_stack, has_strict_locals: @strict_locals, &block).to_s
183+
view._run(method_name, self, locals, OutputBuffer.new, add_to_stack: add_to_stack, has_strict_locals: @strict_locals, &block)&.to_s
184184
end
185185
end
186186
rescue => e

0 commit comments

Comments
 (0)