Move double render check out of AbstractController.

上级 5c3ef8c1
......@@ -41,10 +41,6 @@ def view_context
# Mostly abstracts the fact that calling render twice is a DoubleRenderError.
# Delegates render_to_body and sticks the result in self.response_body.
def render(*args, &block)
if response_body
raise AbstractController::DoubleRenderError
end
options = _normalize_options(*args, &block)
self.response_body = render_to_body(options)
end
......
......@@ -13,6 +13,10 @@ def process_action(*)
end
def render(*args)
if response_body
raise ::AbstractController::DoubleRenderError
end
args << {} unless args.last.is_a?(Hash)
super(*args)
self.content_type ||= args.last[:_template].mime_type.to_s
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册