routes.rb 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. DepotClient::Application.routes.draw do
  10. # The priority is based upon order of creation: first created -> highest priority.
  11. # See how all your routes lay out with "rake routes".
  12. # You can have the root of your site routed with "root" just remember to delete public/index.html.
  13. # root to: 'welcome#index'
  14. # Example of regular route:
  15. # get 'products/:id' => 'catalog#view'
  16. # Example of named route that can be invoked with purchase_url(id: product.id)
  17. # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
  18. # Example resource route (maps HTTP verbs to controller actions automatically):
  19. # resources :products
  20. # Example resource route with options:
  21. # resources :products do
  22. # member do
  23. # get 'short'
  24. # post 'toggle'
  25. # end
  26. #
  27. # collection do
  28. # get 'sold'
  29. # end
  30. # end
  31. # Example resource route with sub-resources:
  32. # resources :products do
  33. # resources :comments, :sales
  34. # resource :seller
  35. # end
  36. # Example resource route with more complex sub-resources:
  37. # resources :products do
  38. # resources :comments
  39. # resources :sales do
  40. # get 'recent', on: :collection
  41. # end
  42. # end
  43. # Example resource route within a namespace:
  44. # namespace :admin do
  45. # # Directs /admin/products/* to Admin::ProductsController
  46. # # (app/controllers/admin/products_controller.rb)
  47. # resources :products
  48. # end
  49. end