diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2013-09-04 15:43:31 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2013-09-04 15:43:52 -0300 |
commit | c27fde26166f71ec68a7fb501435b656f436a687 (patch) | |
tree | aeb6f358a72a940c46a4b4ee0cc142bccc8ec632 | |
parent | a72fdedd40676741cf73f62001a034beec3b10e4 (diff) | |
download | rails-c27fde26166f71ec68a7fb501435b656f436a687.tar.gz rails-c27fde26166f71ec68a7fb501435b656f436a687.tar.bz2 rails-c27fde26166f71ec68a7fb501435b656f436a687.zip |
render_to_string shouldn't play with response_body
-rw-r--r-- | actionpack/lib/action_controller/metal/rendering.rb | 9 |
1 files 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(*) |