Guest User

Untitled

a guest
May 27th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. ActionController::Routing::Routes.draw do |map|
  2. map.resources :users
  3.  
  4. map.root :controller => "forums", :action => "index"
  5.  
  6. map.resource :session, :controller => "session"
  7.  
  8.  
  9. map.connect 'login', :controller => "session", :action => "new"
  10.  
  11. map.connect 'signup', :controller => "users", :action => "new"
  12.  
  13. map.connect 'logout', :controller => "session", :action => "destroy"
  14.  
  15. map.resources :forums
  16.  
  17. map.namespace(:admin) do |admin|
  18. admin.resources :forums
  19. end
  20.  
  21.  
  22. # The priority is based upon order of creation: first created -> highest priority.
  23.  
  24. # Sample of regular route:
  25. # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  26. # Keep in mind you can assign values other than :controller and :action
  27.  
  28. # Sample of named route:
  29. # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  30. # This route can be invoked with purchase_url(:id => product.id)
  31.  
  32. # You can have the root of your site routed by hooking up ''
  33. # -- just remember to delete public/index.html.
  34. # map.connect '', :controller => "welcome"
  35.  
  36. # Allow downloading Web Service WSDL as a file with an extension
  37. # instead of a file named 'wsdl'
  38. map.connect ':controller/service.wsdl', :action => 'wsdl'
  39.  
  40. # Install the default route as the lowest priority.
  41. map.connect ':controller/:action/:id.:format'
  42. map.connect ':controller/:action/:id'
  43. end
Add Comment
Please, Sign In to add comment