class AbstractController::Base
def method_for_action(action_name)
* string - The name of the method that handles the action
==== Returns
* action_name - An action name to find a method name for
==== Parameters
returns nil, an ActionNotFound exception will be raised.
If none of these conditions are true, and method_for_action
the case.
also provide a method (like _handle_method_missing) to handle
If you override this method to handle additional cases, you may
with a template matching the action name is considered to exist.
that should be considered an action. For instance, an HTTP controller
Subclasses may override this method to add additional conditions
method and return "_handle_action_missing" if one is found.
a name that is not an action, it will look for an #action_missing
name as it receives. By default, if #method_for_action receives
handle the action. In normal cases, this method returns the same
Takes an action name and returns the name of the method that will
def method_for_action(action_name) if action_method?(action_name) then action_name elsif respond_to?(:action_missing, true) then "_handle_action_missing" end end