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