routes.rb 2.2 KB

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