提交 67c96ab0 编写于 作者: C Carlos Antonio da Silva

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.
上级 a977b258
......@@ -13,9 +13,5 @@ class << self
:@_view_runtime, :@_stream, :@_url_options, :@_action_has_layout
]
end
def render_to_body(options)
super || " "
end
end
end
......@@ -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.
......
......@@ -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)
......
......@@ -233,10 +233,8 @@ def method_missing(selector, *args)
super
end
end
end
include Behavior
end
end
......@@ -815,8 +815,6 @@ def test_process(controller, action = "show")
end
end
class PostsController < ActionController::Base
module AroundExceptions
class Error < StandardError ; end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册