Guest User

Untitled

a guest
May 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. ctionController::Routing::Routes.draw do |map|
  2. #map.resources :testimonials
  3. map.root :controller => 'products'
  4.  
  5. map.resources :products, :has_many => :testimonials
  6.  
  7. # The priority is based upon order of creation: first created -> highest priority.
  8.  
  9. # Sample of regular route:
  10. # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  11. # Keep in mind you can assign values other than :controller and :action
  12.  
  13. # Sample of named route:
  14. # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  15. # This route can be invoked with purchase_url(:id => product.id)
  16.  
  17. # Sample resource route (maps HTTP verbs to controller actions automatically):
  18. # map.resources :products
  19.  
  20. # Sample resource route with options:
  21. # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
  22.  
  23. # Sample resource route with sub-resources:
  24. # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
  25.  
  26. # Sample resource route with more complex sub-resources
  27. # map.resources :products do |products|
  28. # products.resources :comments
  29. # products.resources :sales, :collection => { :recent => :get }
  30. # end
  31.  
  32. # Sample resource route within a namespace:
  33. # map.namespace :admin do |admin|
  34. # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
  35. # admin.resources :products
  36. # end
  37.  
  38. # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
  39. # map.root :controller => "welcome"
  40.  
  41. # See how all your routes lay out with "rake routes"
  42.  
  43. # Install the default routes as the lowest priority.
  44. # Note: These default routes make all actions in every controller accessible via GET requests. You should
  45. # consider removing the them or commenting them out if you're using named routes and resources.
  46. map.connect ':controller/:action/:id'
  47. map.connect ':controller/:action/:id.:format'
  48. end
Add Comment
Please, Sign In to add comment