aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/basic_implicit_render.rb
diff options
context:
space:
mode:
authorJorge Bejar <jorge@wyeworks.com>2015-06-02 17:12:50 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2015-06-11 16:54:17 -0300
commit6c165773117dc7e60f5bb4762e58c7c522d69fcc (patch)
treec3c3ed07ec0acf5fb1d420dc7f97a40cf6086bce /actionpack/lib/action_controller/metal/basic_implicit_render.rb
parent8d3e6e5f4d97aa8f2b8b8dde949a1b79b50276d1 (diff)
downloadrails-6c165773117dc7e60f5bb4762e58c7c522d69fcc.tar.gz
rails-6c165773117dc7e60f5bb4762e58c7c522d69fcc.tar.bz2
rails-6c165773117dc7e60f5bb4762e58c7c522d69fcc.zip
Return 204 if render is not called in API controllers
Diffstat (limited to 'actionpack/lib/action_controller/metal/basic_implicit_render.rb')
-rw-r--r--actionpack/lib/action_controller/metal/basic_implicit_render.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/basic_implicit_render.rb b/actionpack/lib/action_controller/metal/basic_implicit_render.rb
new file mode 100644
index 0000000000..6c6f8381ff
--- /dev/null
+++ b/actionpack/lib/action_controller/metal/basic_implicit_render.rb
@@ -0,0 +1,11 @@
+module ActionController
+ module BasicImplicitRender
+ def send_action(method, *args)
+ super.tap { default_render unless performed? }
+ end
+
+ def default_render(*args)
+ head :no_content
+ end
+ end
+end