aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderer/template_renderer.rb
diff options
context:
space:
mode:
authorDmitry Vorotilin <d.vorotilin@gmail.com>2012-07-11 12:18:52 +0400
committerDmitry Vorotilin <d.vorotilin@gmail.com>2012-07-18 10:48:24 +0400
commiteb19ca3457c7b9908c71376f9b3b4431fcd24c6f (patch)
treea97dfbd60788f860f92d64748a8b9bd673b23bfd /actionpack/lib/action_view/renderer/template_renderer.rb
parentd00b635242120f4262178909d93faf4473b1055e (diff)
downloadrails-eb19ca3457c7b9908c71376f9b3b4431fcd24c6f.tar.gz
rails-eb19ca3457c7b9908c71376f9b3b4431fcd24c6f.tar.bz2
rails-eb19ca3457c7b9908c71376f9b3b4431fcd24c6f.zip
Common behavior with adding formats to lookup_context for TemplateRenderer and PartialRenderer
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, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb
index 3c1b11396a..156ad4e547 100644
--- a/actionpack/lib/action_view/renderer/template_renderer.rb
+++ b/actionpack/lib/action_view/renderer/template_renderer.rb
@@ -8,9 +8,10 @@ module ActionView
template = determine_template(options)
context = @lookup_context
+ prepend_formats(template.formats)
+
unless context.rendered_format
- context.formats = template.formats unless template.formats.empty?
- context.rendered_format = context.formats.first
+ context.rendered_format = template.formats.first || formats.last
end
render_template(template, options[:layout], options[:locals])