Skip to content

Instantly share code, notes, and snippets.

@collin
Created June 1, 2009 06:54
Show Gist options
  • Select an option

  • Save collin/121277 to your computer and use it in GitHub Desktop.

Select an option

Save collin/121277 to your computer and use it in GitHub Desktop.
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