diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-15 22:07:20 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-17 10:04:38 -0200 |
commit | 67c96ab024f008ad1aee8345c1ae0fd7aa9bf072 (patch) | |
tree | 9f3d18283bbda6e3d1e3a4f376793bde50fddf0d /actionpack/lib | |
parent | a977b2588e46ab5b9b8a1cb2a8f7482988c64486 (diff) | |
download | rails-67c96ab024f008ad1aee8345c1ae0fd7aa9bf072.tar.gz rails-67c96ab024f008ad1aee8345c1ae0fd7aa9bf072.tar.bz2 rails-67c96ab024f008ad1aee8345c1ae0fd7aa9bf072.zip |
Move render_to_body logic to return a spaced string to AC::Rendering
This seems to be required only when calling render :partial with an
empty collection from a controller. This call happens to return no
content, letting the response body empty, which means to Rails that it
should go on and try to find a template to render based on the current
action name, thus failing hard.
Although tests keep all green, we need to check a better way to fix
this.
Diffstat (limited to 'actionpack/lib')
4 files changed, 5 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb index 96707b6587..813b6501d1 100644 --- a/actionpack/lib/action_controller/metal/compatibility.rb +++ b/actionpack/lib/action_controller/metal/compatibility.rb @@ -13,9 +13,5 @@ module ActionController :@_view_runtime, :@_stream, :@_url_options, :@_action_has_layout ] end - - def render_to_body(options) - super || " " - end end end diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index f6e9e4c4ac..a677cdf15d 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -29,6 +29,10 @@ module ActionController self.response_body = nil end + def render_to_body(*) + super || " " + end + private # Normalize arguments by catching blocks and setting them on :update. diff --git a/actionpack/lib/action_controller/metal/streaming.rb b/actionpack/lib/action_controller/metal/streaming.rb index 0e46402962..e9783e6919 100644 --- a/actionpack/lib/action_controller/metal/streaming.rb +++ b/actionpack/lib/action_controller/metal/streaming.rb @@ -216,7 +216,7 @@ module ActionController #:nodoc: end end - # Call render_to_body if we are streaming instead of usual +render+. + # Call render_body if we are streaming instead of usual +render+. def _render_template(options) #:nodoc: if options.delete(:stream) Rack::Chunked::Body.new view_renderer.render_body(view_context, options) diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index c734c914db..b00f69e636 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -233,10 +233,8 @@ module ActionView super end end - end include Behavior - end end |