routes.rb 2.6 KB

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