diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2015-04-06 12:40:02 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2015-04-06 12:40:02 +0200 |
commit | ca4417d333292b5d345cc64d3e4bbff1b491e8e3 (patch) | |
tree | f8a26e4abe62be6dea09924864be6b939c3bf2f8 /actionpack/lib | |
parent | 51eacc71c7d2a6d0fc23556b32e12a21ee49b948 (diff) | |
parent | 0de4a23d1cfa6ef44a27ac8aca5055487282460e (diff) | |
download | rails-ca4417d333292b5d345cc64d3e4bbff1b491e8e3.tar.gz rails-ca4417d333292b5d345cc64d3e4bbff1b491e8e3.tar.bz2 rails-ca4417d333292b5d345cc64d3e4bbff1b491e8e3.zip |
Merge pull request #19377 from sb8244/issue-19036
when a template is missing for the default render, do head no_content instead
Diffstat (limited to 'actionpack/lib')
-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) |