aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-06-30 11:47:14 -0300
committerJosé Valim <jose.valim@gmail.com>2011-06-30 11:47:36 -0300
commit9c9ec2172e46710d1d5ac513a4ff52df35fef51f (patch)
tree39c761c4bfcda6f87d79d2c6bb10beeac3623cea /actionpack/lib/action_controller
parent35cdd256c00dd08b54c22d5b7f38dbcc897d876b (diff)
downloadrails-9c9ec2172e46710d1d5ac513a4ff52df35fef51f.tar.gz
rails-9c9ec2172e46710d1d5ac513a4ff52df35fef51f.tar.bz2
rails-9c9ec2172e46710d1d5ac513a4ff52df35fef51f.zip
Make sure respond_with with :js tries to render a template in all cases
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/metal/responder.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/responder.rb b/actionpack/lib/action_controller/metal/responder.rb
index ebadb29ea7..f3b7357e64 100644
--- a/actionpack/lib/action_controller/metal/responder.rb
+++ b/actionpack/lib/action_controller/metal/responder.rb
@@ -162,6 +162,11 @@ module ActionController #:nodoc:
navigation_behavior(e)
end
+ # to_js simply tries to render a template. If no template is found, raises the error.
+ def to_js
+ default_render
+ end
+
# All other formats follow the procedure below. First we try to render a
# template, if the template is not available, we verify if the resource
# responds to :to_format and display it.