Skip to content
Browse files

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.
  • Loading branch information...
1 parent a977b25 commit 67c96ab024f008ad1aee8345c1ae0fd7aa9bf072 @carlosantoniodasilva carlosantoniodasilva committed Jan 15, 2012
View
4 actionpack/lib/action_controller/metal/compatibility.rb
@@ -13,9 +13,5 @@ class << self
:@_view_runtime, :@_stream, :@_url_options, :@_action_has_layout
]
end
-
- def render_to_body(options)
- super || " "
- end
end
end
View
4 actionpack/lib/action_controller/metal/rendering.rb
@@ -29,6 +29,10 @@ def render_to_string(*)
self.response_body = nil
end
+ def render_to_body(*)
+ super || " "
+ end
+
private
# Normalize arguments by catching blocks and setting them on :update.
View
2 actionpack/lib/action_controller/metal/streaming.rb
@@ -216,7 +216,7 @@ def _process_options(options) #: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)
View
2 actionpack/lib/action_view/test_case.rb
@@ -233,10 +233,8 @@ def method_missing(selector, *args)
super
end
end
-
end
include Behavior
-
end
end
View
2 actionpack/test/controller/filters_test.rb
@@ -815,8 +815,6 @@ def test_process(controller, action = "show")
end
end
-
-
class PostsController < ActionController::Base
module AroundExceptions
class Error < StandardError ; end

0 comments on commit 67c96ab

Please sign in to comment.
Something went wrong with that request. Please try again.