routes.rb 2.3 KB

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