aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/mime_responds.rb
diff options
context:
space:
mode:
authorJustin Coyne <jcoyne@justincoyne.com>2015-12-30 12:59:23 -0600
committerJustin Coyne <jcoyne@justincoyne.com>2016-02-25 07:14:49 -0600
commit48f140cf7459c963a54637c897448b959dbbfd26 (patch)
tree96ab619b7aa2d8fb9adf591a735ed3673a290e2a /actionpack/lib/action_controller/metal/mime_responds.rb
parent46cb45df485d6f4d67a8e448a142bcab47fc0f2a (diff)
downloadrails-48f140cf7459c963a54637c897448b959dbbfd26.tar.gz
rails-48f140cf7459c963a54637c897448b959dbbfd26.tar.bz2
rails-48f140cf7459c963a54637c897448b959dbbfd26.zip
Render default template if block doesn't render
When a `respond_to` collector doesn't have a response, then a `:no_content` response should be rendered. This brings the default rendering behavior introduced by https://github.com/rails/rails/issues/19036 to controller methods employing `respond_to`
Diffstat (limited to 'actionpack/lib/action_controller/metal/mime_responds.rb')
-rw-r--r--actionpack/lib/action_controller/metal/mime_responds.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb
index 173a14a1d2..2e89af1a5e 100644
--- a/actionpack/lib/action_controller/metal/mime_responds.rb
+++ b/actionpack/lib/action_controller/metal/mime_responds.rb
@@ -198,7 +198,7 @@ module ActionController #:nodoc:
_process_format(format)
_set_rendered_content_type format
response = collector.response
- response ? response.call : render({})
+ response.call if response
else
raise ActionController::UnknownFormat
end