diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-17 21:33:09 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-17 21:33:09 -0500 |
commit | a22a778f860032b9d6bf3a8b19d0b22fc174550c (patch) | |
tree | 2d02522bbebd14347c9228b7fa5fc0ab563f8f59 /actionpack/lib/action_controller/base | |
parent | 1414e2afbba0ab116632ecabf8ed92ddf09dcba4 (diff) | |
download | rails-a22a778f860032b9d6bf3a8b19d0b22fc174550c.tar.gz rails-a22a778f860032b9d6bf3a8b19d0b22fc174550c.tar.bz2 rails-a22a778f860032b9d6bf3a8b19d0b22fc174550c.zip |
render_for_text pushes a body part instead of replacing the whole body
Diffstat (limited to 'actionpack/lib/action_controller/base')
-rw-r--r-- | actionpack/lib/action_controller/base/responder.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/base/responder.rb b/actionpack/lib/action_controller/base/responder.rb index 989f82444b..1aee980da6 100644 --- a/actionpack/lib/action_controller/base/responder.rb +++ b/actionpack/lib/action_controller/base/responder.rb @@ -5,18 +5,19 @@ module ActionController end private - def render_for_text(text = nil, append_response = false) #:nodoc: + def render_for_text(text) #:nodoc: @performed_render = true - if append_response - response.body ||= '' - response.body << text.to_s - else - response.body = case text - when Proc then text - when nil then " " # Safari doesn't pass the headers of the return if the response is zero length - else text.to_s + case text + when Proc + response.body = text + when nil + # Safari 2 doesn't pass response headers if the response is zero-length + if response.body_parts.empty? + response.body_parts << ' ' end + else + response.body_parts << text end end @@ -39,4 +40,4 @@ module ActionController end end end -end
\ No newline at end of file +end |