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:
parent
a72fdedd40
commit
c27fde2616
1 changed files with 5 additions and 4 deletions
|
@ -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(*)
|
||||||
|
|
Loading…
Reference in a new issue