aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/abstract/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/abstract/base.rb')
-rw-r--r--actionpack/lib/action_controller/abstract/base.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/abstract/base.rb b/actionpack/lib/action_controller/abstract/base.rb
index ade7719cc0..a87a490a2d 100644
--- a/actionpack/lib/action_controller/abstract/base.rb
+++ b/actionpack/lib/action_controller/abstract/base.rb
@@ -29,10 +29,21 @@ module AbstractController
private
+ # It is possible for respond_to?(action_name) to be false and
+ # respond_to?(:action_missing) to be false if respond_to_action?
+ # is overridden in a subclass. For instance, ActionController::Base
+ # overrides it to include the case where a template matching the
+ # action_name is found.
def process_action
- respond_to?(action_name) ? send(action_name) : send(:action_missing, action_name)
+ if respond_to?(action_name) then send(action_name)
+ elsif respond_to?(:action_missing, true) then send(:action_missing, action_name)
+ end
end
+ # Override this to change the conditions that will raise an
+ # ActionNotFound error. If you accept a difference case,
+ # you must handle it by also overriding process_action and
+ # handling the case.
def respond_to_action?(action_name)
respond_to?(action_name) || respond_to?(:action_missing, true)
end