routes.rb 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #---
  2. # Excerpted from "Agile Web Development with Rails",
  3. # published by The Pragmatic Bookshelf.
  4. # Copyrights apply to this code. It may not be used to create training material,
  5. # courses, books, articles, and the like. Contact us if you are in doubt.
  6. # We make no guarantees that this code is fit for any purpose.
  7. # Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information.
  8. #---
  9. #---
  10. # Excerpted from "Agile Web Development with Rails, 4rd Ed.",
  11. # published by The Pragmatic Bookshelf.
  12. # Copyrights apply to this code. It may not be used to create training material,
  13. # courses, books, articles, and the like. Contact us if you are in doubt.
  14. # We make no guarantees that this code is fit for any purpose.
  15. # Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information.
  16. #---
  17. Depot::Application.routes.draw do
  18. resources :line_items
  19. resources :carts
  20. get "store/index"
  21. resources :products
  22. # ...
  23. # The priority is based upon order of creation:
  24. # first created -> highest priority.
  25. # Sample of regular route:
  26. # match 'products/:id' => 'catalog#view'
  27. # Keep in mind you can assign values other than :controller and :action
  28. # Sample of named route:
  29. # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  30. # This route can be invoked with purchase_url(:id => product.id)
  31. # Sample resource route (maps HTTP verbs to controller actions automatically):
  32. # resources :products
  33. # Sample resource route with options:
  34. # resources :products do
  35. # member do
  36. # get 'short'
  37. # post 'toggle'
  38. # end
  39. #
  40. # collection do
  41. # get 'sold'
  42. # end
  43. # end
  44. # Sample resource route with sub-resources:
  45. # resources :products do
  46. # resources :comments, :sales
  47. # resource :seller
  48. # end
  49. # Sample resource route with more complex sub-resources
  50. # resources :products do
  51. # resources :comments
  52. # resources :sales do
  53. # get 'recent', :on => :collection
  54. # end
  55. # end
  56. # Sample resource route within a namespace:
  57. # namespace :admin do
  58. # # Directs /admin/products/* to Admin::ProductsController
  59. # # (app/controllers/admin/products_controller.rb)
  60. # resources :products
  61. # end
  62. # You can have the root of your site routed with "root"
  63. # just remember to delete public/index.html.
  64. # root :to => "welcome#index"
  65. root :to => 'store#index', :as => 'store'
  66. # ...
  67. # See how all your routes lay out with "rake routes"
  68. # This is a legacy wild controller route that's not recommended for RESTful applications.
  69. # Note: This route will make all actions in every controller accessible via GET requests.
  70. # match ':controller(/:action(/:id(.:format)))'
  71. end