Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 2.23 KB | None | 0 0
  1. ShopApp::Application.routes.draw do
  2.  
  3.   resources :shop_controllers do
  4.   resources :products end
  5. # end
  6.   match 'products/:id' => 'products#show', :foo => "bar"
  7.  
  8.   root :to => "shop_controllers#index"
  9.   root :to => "shop_controllers#show"
  10.   # root :to => "shop_controllers#update"
  11.   # root :to => "shop_controllers#edit"
  12.   # root :to => "shop_controllers#destroy"
  13.   # root :to => "shop_controllers#new"
  14.   # root :to => "shop_controllers#create"
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.   # The priority is based upon order of creation:
  23.   # first created -> highest priority.
  24.  
  25.   # Sample of regular route:
  26.   #   match 'products/:id' => 'catalog#view'
  27.   # Keep in mind you can assign values other than :controller and :action
  28.  
  29.   # Sample of named route:
  30.   #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  31.   # This route can be invoked with purchase_url(:id => product.id)
  32.  
  33.   # Sample resource route (maps HTTP verbs to controller actions automatically):
  34.   #   resources :products
  35.  
  36.   # Sample resource route with options:
  37.   #   resources :products do
  38.   #     member do
  39.   #       get 'short'
  40.   #       post 'toggle'
  41.   #     end
  42.   #
  43.   #     collection do
  44.   #       get 'sold'
  45.   #     end
  46.   #   end
  47.  
  48.   # Sample resource route with sub-resources:
  49.   #   resources :products do
  50.   #     resources :comments, :sales
  51.   #     resource :seller
  52.   #   end
  53.  
  54.   # Sample resource route with more complex sub-resources
  55.   #   resources :products do
  56.   #     resources :comments
  57.   #     resources :sales do
  58.   #       get 'recent', :on => :collection
  59.   #     end
  60.   #   end
  61.  
  62.   # Sample resource route within a namespace:
  63.   #   namespace :admin do
  64.   #     # Directs /admin/products/* to Admin::ProductsController
  65.   #     # (app/controllers/admin/products_controller.rb)
  66.   #     resources :products
  67.   #   end
  68.  
  69.   # You can have the root of your site routed with "root"
  70.   # just remember to delete public/index.html.
  71.   # root :to => 'welcome#index'
  72.  
  73.   # See how all your routes lay out with "rake routes"
  74.  
  75.   # This is a legacy wild controller route that's not recommended for RESTful applications.
  76.   # Note: This route will make all actions in every controller accessible via GET requests.
  77.   # match ':controller(/:action(/:id))(.:format)'
  78. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement