Advertisement
nathandunn

Routes.rb

Sep 8th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.86 KB | None | 0 0
  1. SampleApp::Application.routes.draw do
  2.   get "static_pages/home"
  3.   get "static_pages/help"
  4. end
  5.   # The priority is based upon order of creation:
  6.   # first created -> highest priority.
  7.  
  8.   # Sample of regular route:
  9.   #   match 'products/:id' => 'catalog#view'
  10.   # Keep in mind you can assign values other than :controller and :action
  11.  
  12.   # Sample of named route:
  13.   #   match 'products/:id/purchase' => 'catalog#purchase', :as => :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.   #   resources :products
  18.  
  19.   # Sample resource route with options:
  20.   #   resources :products do
  21.   #     member do
  22.   #       get 'short'
  23.   #       post 'toggle'
  24.   #     end
  25.   #
  26.   #     collection do
  27.   #       get 'sold'
  28.   #     end
  29.   #   end
  30.  
  31.   # Sample resource route with sub-resources:
  32.   #   resources :products do
  33.   #     resources :comments, :sales
  34.   #     resource :seller
  35.   #   end
  36.  
  37.   # Sample resource route with more complex sub-resources
  38.   #   resources :products do
  39.   #     resources :comments
  40.   #     resources :sales do
  41.   #       get 'recent', :on => :collection
  42.   #     end
  43.   #   end
  44.  
  45.   # Sample resource route within a namespace:
  46.   #   namespace :admin do
  47.   #     # Directs /admin/products/* to Admin::ProductsController
  48.   #     # (app/controllers/admin/products_controller.rb)
  49.   #     resources :products
  50.   #   end
  51.  
  52.   # You can have the root of your site routed with "root"
  53.   # just remember to delete public/index.html.
  54.   # root :to => 'welcome#index'
  55.  
  56.   # See how all your routes lay out with "rake routes"
  57.  
  58.   # This is a legacy wild controller route that's not recommended for RESTful applications.
  59.   # Note: This route will make all actions in every controller accessible via GET requests.
  60.   # match ':controller(/:action(/:id))(.:format)'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement