1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

render_to_string shouldn't play with response_body

This commit is contained in:
Santiago Pastorino 2013-09-04 15:43:31 -03:00
parent a72fdedd40
commit c27fde2616

View file

@ -18,13 +18,14 @@ module ActionController
# Overwrite render_to_string because body can now be set to a rack body. # Overwrite render_to_string because body can now be set to a rack body.
def render_to_string(*) def render_to_string(*)
if self.response_body = super result = super
if result.respond_to?(:each)
string = "" string = ""
self.response_body.each { |r| string << r } result.each { |r| string << r }
string string
else
result
end end
ensure
self.response_body = nil
end end
def render_to_body(*) def render_to_body(*)