routes.rb 842 B

1234567891011121314151617181920212223242526272829
  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 'admin' => 'admin#index'
  11. controller :sessions do
  12. get 'login' => :new
  13. post 'login' => :create
  14. delete 'logout' => :destroy
  15. end
  16. resources :users
  17. resources :products do
  18. get :who_bought, on: :member
  19. end
  20. scope '(:locale)' do
  21. resources :orders
  22. resources :line_items
  23. resources :carts
  24. get 'store/index'
  25. root 'store#index', as: 'store', via: :all
  26. end
  27. end