Browse files

Pass the proper method_name instead of hardcoding to action_name.

Conflicts:

	actionpack/lib/action_controller/metal/implicit_render.rb
  • Loading branch information...
1 parent 555d016 commit 94907035b6a4a8e415cf19471a7ae77fac937209 @josevalim josevalim committed Mar 29, 2011
View
2 actionpack/lib/abstract_controller/callbacks.rb
@@ -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
View
18 actionpack/lib/action_controller/metal/implicit_render.rb
@@ -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, _prefixes)
- "default_render"
- end
+ super || if template_exists?(action_name.to_s, _prefixes)
+ action_name.to_s
end
end
end

0 comments on commit 9490703

Please sign in to comment.