routes.rb 1.6 KB

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