From c27fde26166f71ec68a7fb501435b656f436a687 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 4 Sep 2013 15:43:31 -0300 Subject: [PATCH] render_to_string shouldn't play with response_body --- actionpack/lib/action_controller/metal/rendering.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index abcc9d4acf..7b4f1f73a5 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -18,13 +18,14 @@ module ActionController # Overwrite render_to_string because body can now be set to a rack body. def render_to_string(*) - if self.response_body = super + result = super + if result.respond_to?(:each) string = "" - self.response_body.each { |r| string << r } + result.each { |r| string << r } string + else + result end - ensure - self.response_body = nil end def render_to_body(*)