aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/implicit_render.rb
diff options
context:
space:
mode:
authorVinicius Stock <instantink+pair+vinicius@hp.com>2017-05-30 11:12:34 -0300
committerVinicius Stock <instantink+pair+vinicius@hp.com>2018-04-20 11:01:05 -0300
commit297a579de4f8cb8d8144b18d85ee370558c0977c (patch)
treef2ebeb2d607805869d8e1d354a8bddfaf046ae00 /actionpack/lib/action_controller/metal/implicit_render.rb
parentb6ee4e4b989bfc2fe50b2b830fdcb90ef9e23d9a (diff)
downloadrails-297a579de4f8cb8d8144b18d85ee370558c0977c.tar.gz
rails-297a579de4f8cb8d8144b18d85ee370558c0977c.tar.bz2
rails-297a579de4f8cb8d8144b18d85ee370558c0977c.zip
Create MissingExactTemplate exception with separate template
Diffstat (limited to 'actionpack/lib/action_controller/metal/implicit_render.rb')
-rw-r--r--actionpack/lib/action_controller/metal/implicit_render.rb14
1 files changed, 2 insertions, 12 deletions
diff --git a/actionpack/lib/action_controller/metal/implicit_render.rb b/actionpack/lib/action_controller/metal/implicit_render.rb
index ac0c127cdc..d3bb58f48b 100644
--- a/actionpack/lib/action_controller/metal/implicit_render.rb
+++ b/actionpack/lib/action_controller/metal/implicit_render.rb
@@ -41,18 +41,8 @@ module ActionController
raise ActionController::UnknownFormat, message
elsif interactive_browser_request?
- message = "#{self.class.name}\##{action_name} is missing a template " \
- "for this request format and variant.\n\n" \
- "request.formats: #{request.formats.map(&:to_s).inspect}\n" \
- "request.variant: #{request.variant.inspect}\n\n" \
- "NOTE! For XHR/Ajax or API requests, this action would normally " \
- "respond with 204 No Content: an empty white screen. Since you're " \
- "loading it in a web browser, we assume that you expected to " \
- "actually render a template, not nothing, so we're showing an " \
- "error to be extra-clear. If you expect 204 No Content, carry on. " \
- "That's what you'll get from an XHR or API request. Give it a shot."
-
- raise ActionController::UnknownFormat, message
+ message = "#{self.class.name}\##{action_name} is missing a template for request formats: #{request.formats.map(&:to_s).join(',')}"
+ raise ActionController::MissingExactTemplate, message
else
logger.info "No template found for #{self.class.name}\##{action_name}, rendering head :no_content" if logger
super