aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderer/template_renderer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/renderer/template_renderer.rb')
-rw-r--r--actionpack/lib/action_view/renderer/template_renderer.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb
index d15e75637a..a27d5dd1b1 100644
--- a/actionpack/lib/action_view/renderer/template_renderer.rb
+++ b/actionpack/lib/action_view/renderer/template_renderer.rb
@@ -10,10 +10,9 @@ module ActionView
template = determine_template(options)
context = @lookup_context
- prepend_formats(template.formats)
-
unless context.rendered_format
- context.rendered_format = template.formats.first || formats.last
+ context.formats = template.formats unless template.formats.empty?
+ context.rendered_format = context.formats.first
end
render_template(template, options[:layout], options[:locals])