Created
July 3, 2010 16:49
-
-
Save unakatsuo/462692 to your computer and use it in GitHub Desktop.
Rails forward action
This file contains 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
class ApplicationController < ActionController::Base | |
helper :all # include all helpers, all the time | |
protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
# Scrub sensitive parameters from your log | |
# filter_parameter_logging :password | |
protected | |
# | |
def forward_action(action_name) | |
raise "Unknown action: #{action_name}" unless self.respond_to?(action_name) | |
self.action_name = request.path_parameters['action'] = action_name.to_s | |
__send__(action_name) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
may work with 2.3 only.