diff options
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/rendering.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index a168b1b4c5..1dec3f2c3e 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -41,10 +41,6 @@ module AbstractController # 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 diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index 72e2bbd00e..8f03035b2b 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -13,6 +13,10 @@ module ActionController 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 |