Advertisement
Guest User

Untitled

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