Permalink
Browse files

Pass the proper method_name instead of hardcoding to action_name.

  • Loading branch information...
1 parent 3ed8a33 commit 4e2bacdf7cbece8225552e64358fb53ad6b70540 @josevalim josevalim committed Mar 29, 2011
@@ -14,7 +14,7 @@ module Callbacks
# Override AbstractController::Base's process_action to run the
# process_action callbacks around the normal behavior.
def process_action(method_name, *args)
- run_callbacks(:process_action, action_name) do
+ run_callbacks(:process_action, method_name) do
super
end
end
@@ -1,20 +1,22 @@
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
render
end
def method_for_action(action_name)
- super || begin
- if template_exists?(action_name.to_s, _prefix)
- "default_render"
- end
+ super || if template_exists?(action_name.to_s, _prefix)
+ action_name.to_s
end
end
end

0 comments on commit 4e2bacd

Please sign in to comment.