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