1 ActionController::Routing::Routes.draw do |map|
2 # The priority is based upon order of creation: first created -> highest priority.
4 :collection => { :search => [:get], :list => [:get] },
5 :member => { :print => [:get] }
7 # Sample of regular route:
8 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
9 # Keep in mind you can assign values other than :controller and :action
11 # Sample of named route:
12 # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
13 # This route can be invoked with purchase_url(:id => product.id)
15 # Sample resource route (maps HTTP verbs to controller actions automatically):
16 # map.resources :products
18 # Sample resource route with options:
19 # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
21 # Sample resource route with sub-resources:
22 # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
24 # Sample resource route with more complex sub-resources
25 # map.resources :products do |products|
26 # products.resources :comments
27 # products.resources :sales, :collection => { :recent => :get }
30 # Sample resource route within a namespace:
31 # map.namespace :admin do |admin|
32 # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
33 # admin.resources :products
36 # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
37 # map.root :controller => "welcome"
39 # See how all your routes lay out with "rake routes"
41 # Install the default routes as the lowest priority.
42 # Note: These default routes make all actions in every controller accessible via GET requests. You should
43 # consider removing or commenting them out if you're using named routes and resources.
44 map.connect ':controller/:action/:id'
45 map.connect ':controller/:action/:id.:format'