aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-03-29 19:30:59 +0200
committerJosé Valim <jose.valim@gmail.com>2011-03-29 19:30:59 +0200
commit94907035b6a4a8e415cf19471a7ae77fac937209 (patch)
treea6f4469457102648e59b29d5cd559ebaf19b3837 /actionpack/lib/action_controller
parent555d0163897601010ab1305f41ed393ec517b61e (diff)
downloadrails-94907035b6a4a8e415cf19471a7ae77fac937209.tar.gz
rails-94907035b6a4a8e415cf19471a7ae77fac937209.tar.bz2
rails-94907035b6a4a8e415cf19471a7ae77fac937209.zip
Pass the proper method_name instead of hardcoding to action_name.
Conflicts: actionpack/lib/action_controller/metal/implicit_render.rb
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/metal/implicit_render.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/implicit_render.rb b/actionpack/lib/action_controller/metal/implicit_render.rb
index cfa7004048..4b301c0d90 100644
--- a/actionpack/lib/action_controller/metal/implicit_render.rb
+++ b/actionpack/lib/action_controller/metal/implicit_render.rb
@@ -1,9 +1,13 @@
module ActionController
module ImplicitRender
- def send_action(*)
- ret = super
- default_render unless response_body
- ret
+ def send_action(method, *args)
+ if respond_to?(method, true)
+ ret = super
+ default_render unless response_body
+ ret
+ else
+ default_render
+ end
end
def default_render
@@ -11,10 +15,8 @@ module ActionController
end
def method_for_action(action_name)
- super || begin
- if template_exists?(action_name.to_s, _prefixes)
- "default_render"
- end
+ super || if template_exists?(action_name.to_s, _prefixes)
+ action_name.to_s
end
end
end