aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderer/template_renderer.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-08-25 19:31:42 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-08-25 19:31:42 -0700
commite0fc5da35393c70d5ac61aaa96705f03195486fc (patch)
treeb5fba23f5475f48692b6298863217669c0f0a624 /actionpack/lib/action_view/renderer/template_renderer.rb
parentadf6e30e3ad448c1edf2878255922a3faaa77c99 (diff)
parent424a5a7d46176eaa9617ad4fdc99d8c2be53b186 (diff)
downloadrails-e0fc5da35393c70d5ac61aaa96705f03195486fc.tar.gz
rails-e0fc5da35393c70d5ac61aaa96705f03195486fc.tar.bz2
rails-e0fc5da35393c70d5ac61aaa96705f03195486fc.zip
Merge pull request #12006 from kassio/11605-render-with-context-format
Render with context format
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])