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