diff options
author | Stephen Bussey <steve.bussey@salesloft.com> | 2015-03-17 10:36:21 -0400 |
---|---|---|
committer | Stephen Bussey <steve.bussey@salesloft.com> | 2015-04-05 15:46:50 -0400 |
commit | 0de4a23d1cfa6ef44a27ac8aca5055487282460e (patch) | |
tree | ed20e13bfae6f75facebf8ee24f7e7c5da25fb53 /actionpack/lib/action_controller | |
parent | 9040699aed64a725cc66461d63f794abc2f13afc (diff) | |
download | rails-0de4a23d1cfa6ef44a27ac8aca5055487282460e.tar.gz rails-0de4a23d1cfa6ef44a27ac8aca5055487282460e.tar.bz2 rails-0de4a23d1cfa6ef44a27ac8aca5055487282460e.zip |
head no_content when there is no template or action performed
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/implicit_render.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/implicit_render.rb b/actionpack/lib/action_controller/metal/implicit_render.rb index ae04b53825..99e96a9547 100644 --- a/actionpack/lib/action_controller/metal/implicit_render.rb +++ b/actionpack/lib/action_controller/metal/implicit_render.rb @@ -7,7 +7,12 @@ module ActionController end def default_render(*args) - render(*args) + if template_exists?(action_name.to_s, _prefixes, variants: request.variant) + render(*args) + else + logger.info "No template found for #{self.class.name}\##{action_name}, rendering head :no_content" + head :no_content + end end def method_for_action(action_name) |