routes.rb 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. Depot::Application.routes.draw do
  10. resources :orders
  11. resources :line_items
  12. resources :carts
  13. get "store/index"
  14. resources :products
  15. # ...
  16. # The priority is based upon order of creation:
  17. # first created -> highest priority.
  18. # Sample of regular route:
  19. # match 'products/:id' => 'catalog#view'
  20. # Keep in mind you can assign values other than :controller and :action
  21. # Sample of named route:
  22. # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  23. # This route can be invoked with purchase_url(:id => product.id)
  24. # Sample resource route (maps HTTP verbs to controller actions automatically):
  25. # resources :products
  26. # Sample resource route with options:
  27. # resources :products do
  28. # member do
  29. # get 'short'
  30. # post 'toggle'
  31. # end
  32. #
  33. # collection do
  34. # get 'sold'
  35. # end
  36. # end
  37. # Sample resource route with sub-resources:
  38. # resources :products do
  39. # resources :comments, :sales
  40. # resource :seller
  41. # end
  42. # Sample resource route with more complex sub-resources
  43. # resources :products do
  44. # resources :comments
  45. # resources :sales do
  46. # get 'recent', :on => :collection
  47. # end
  48. # end
  49. # Sample resource route within a namespace:
  50. # namespace :admin do
  51. # # Directs /admin/products/* to Admin::ProductsController
  52. # # (app/controllers/admin/products_controller.rb)
  53. # resources :products
  54. # end
  55. # You can have the root of your site routed with "root"
  56. # just remember to delete public/index.html.
  57. # root :to => 'welcome#index'
  58. root to: 'store#index', as: 'store'
  59. # ...
  60. # See how all your routes lay out with "rake routes"
  61. # This is a legacy wild controller route that's not recommended for RESTful applications.
  62. # Note: This route will make all actions in every controller accessible via GET requests.
  63. # match ':controller(/:action(/:id))(.:format)'
  64. end