Created
January 29, 2010 21:36
-
-
Save learnist/290167 to your computer and use it in GitHub Desktop.
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
route_options = {:controller => 'toys', :action => 'index', :owner_id => 'toy_owner'} | |
# initialize Mapper with the current RouteSet | |
mapper = ActionController::Routing::RouteSet::Mapper.new(ActionController::Routing::Routes) | |
# create a new named_route | |
new_named_route = mapper.named_route('rubber_duck', 'rubber_duck', route_options) | |
# add to current RouteSet | |
ActionController::Routing::Routes.routes.insert(0, new_named_route) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment