Created
June 1, 2009 06:54
-
-
Save collin/121277 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module AbstractController | |
| class Base | |
| private | |
| # Modification of abstract controllers process action to take and | |
| # pass on any arguments to "send_action" (currently alias for "send") | |
| def process_action(*args) | |
| send_action(*args) | |
| end | |
| end | |
| end | |
| module ActionController | |
| class ActionArgsController < Base # new_base | |
| private | |
| def process_action(action_name) | |
| super(action_name, *action_arguments_for(action_name)) | |
| end | |
| def action_arguments_for(action_name) | |
| # implementation returning array which containes values from params hash | |
| # uses default values and raises error for bad requests | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment