aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/rendering.rb
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@github.com>2019-03-01 14:06:41 -0800
committerGitHub <noreply@github.com>2019-03-01 14:06:41 -0800
commited6364f7b6579a890c5cedc3c9e5b2f8af586e9e (patch)
treed30267bf589b995579904244316829156d14b5f6 /actionview/lib/action_view/rendering.rb
parent2939c2c0e011347d06ba3cc9dfe4ebe3b08f6799 (diff)
parentbcd42ae974eb04cb5def7a01d194e70b87bc4152 (diff)
downloadrails-ed6364f7b6579a890c5cedc3c9e5b2f8af586e9e.tar.gz
rails-ed6364f7b6579a890c5cedc3c9e5b2f8af586e9e.tar.bz2
rails-ed6364f7b6579a890c5cedc3c9e5b2f8af586e9e.zip
Merge pull request #35429 from jhawthorn/template_format_nil
Allow nil format on templates
Diffstat (limited to 'actionview/lib/action_view/rendering.rb')
-rw-r--r--actionview/lib/action_view/rendering.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb
index e5e2771323..ac861c44d4 100644
--- a/actionview/lib/action_view/rendering.rb
+++ b/actionview/lib/action_view/rendering.rb
@@ -118,7 +118,8 @@ module ActionView
renderer.render_to_object(context, options)
end
- @rendered_format = Template::Types[rendered_template.format]
+ rendered_format = rendered_template.format || lookup_context.formats.first
+ @rendered_format = Template::Types[rendered_format]
rendered_template.body
end