2005-02-15 01:45:35 +00:00
|
|
|
ActionController::Routing::Routes.draw do |map|
|
|
|
|
# The priority is based upon order of creation: first created -> highest priority.
|
|
|
|
|
2006-03-20 06:20:18 +00:00
|
|
|
# Sample of regular route:
|
2005-02-15 01:45:35 +00:00
|
|
|
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
|
|
|
# Keep in mind you can assign values other than :controller and :action
|
2005-02-20 10:55:08 +00:00
|
|
|
|
2006-03-20 06:20:18 +00:00
|
|
|
# Sample of named route:
|
|
|
|
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
|
|
|
# This route can be invoked with purchase_url(:id => product.id)
|
2006-12-04 00:12:00 +00:00
|
|
|
|
|
|
|
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
|
|
|
# map.resources :products
|
|
|
|
|
|
|
|
# Sample resource route with options:
|
|
|
|
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
|
2006-03-20 06:20:18 +00:00
|
|
|
|
2006-12-04 00:12:00 +00:00
|
|
|
# You can have the root of your site routed with map.root
|
2005-03-20 23:39:07 +00:00
|
|
|
# -- just remember to delete public/index.html.
|
2006-12-04 00:12:00 +00:00
|
|
|
# map.root :controller => "welcome"
|
2005-03-20 23:39:07 +00:00
|
|
|
|
2005-02-15 01:45:35 +00:00
|
|
|
# Install the default route as the lowest priority.
|
|
|
|
map.connect ':controller/:action/:id'
|
|
|
|
end
|