aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-03-15 03:21:10 +0100
committerPiotr Sarnacki <drogus@gmail.com>2012-03-17 14:15:50 +0100
commit1eb6189404f53ae59e4cb47ef9d5ad3a9bec3064 (patch)
treeb5d31beb5c08b2b5482c7af7c1fc927c106f259e /actionpack/lib
parente135ff1afdda064ad727691502761d7e552448a9 (diff)
downloadrails-1eb6189404f53ae59e4cb47ef9d5ad3a9bec3064.tar.gz
rails-1eb6189404f53ae59e4cb47ef9d5ad3a9bec3064.tar.bz2
rails-1eb6189404f53ae59e4cb47ef9d5ad3a9bec3064.zip
Fix #5440 - multiple render_to_string breaks partials formats
This fixes situation where rendering template to string sets `rendered_format` to the format rendered there. This is ok to have consistent formats rendered in partials, but it breaks on next renders if format is explicitly set or on last render where default format does not necessarily need to be the format of first rendered template.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/abstract_controller/rendering.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb
index 9019c07bca..f74fd6ac4a 100644
--- a/actionpack/lib/abstract_controller/rendering.rb
+++ b/actionpack/lib/abstract_controller/rendering.rb
@@ -106,6 +106,7 @@ module AbstractController
# Find and renders a template based on the options given.
# :api: private
def _render_template(options) #:nodoc:
+ lookup_context.rendered_format = nil if options[:formats]
view_renderer.render(view_context, options)
end