[1] | 1 | ActionController::Routing::Routes.draw do |map| |
---|
| 2 | map.resources :galleries |
---|
| 3 | |
---|
| 4 | map.resources :test1s |
---|
| 5 | |
---|
| 6 | # The priority is based upon order of creation: first created -> highest priority. |
---|
| 7 | |
---|
| 8 | # Sample of regular route: |
---|
| 9 | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' |
---|
| 10 | # Keep in mind you can assign values other than :controller and :action |
---|
| 11 | |
---|
| 12 | # Sample of named route: |
---|
| 13 | # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' |
---|
| 14 | # This route can be invoked with purchase_url(:id => product.id) |
---|
| 15 | |
---|
| 16 | # Sample resource route (maps HTTP verbs to controller actions automatically): |
---|
| 17 | # map.resources :products |
---|
| 18 | |
---|
| 19 | # Sample resource route with options: |
---|
| 20 | # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } |
---|
| 21 | |
---|
| 22 | # Sample resource route with sub-resources: |
---|
| 23 | # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller |
---|
| 24 | |
---|
| 25 | # Sample resource route within a namespace: |
---|
| 26 | # map.namespace :admin do |admin| |
---|
| 27 | # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb) |
---|
| 28 | # admin.resources :products |
---|
| 29 | # end |
---|
| 30 | |
---|
| 31 | # You can have the root of your site routed with map.root -- just remember to delete public/index.html. |
---|
| 32 | # map.root :controller => "welcome" |
---|
| 33 | |
---|
| 34 | # See how all your routes lay out with "rake routes" |
---|
| 35 | |
---|
| 36 | # Install the default routes as the lowest priority. |
---|
| 37 | map.connect ':controller/:action/:id' |
---|
| 38 | map.connect ':controller/:action/:id.:format' |
---|
| 39 | end |
---|