routes.rb 2.2 KB

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