Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.99 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ActionController::Routing::Routes.draw do |map|
  2.  
  3.   # Sample of named route:
  4.   # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  5.   # This route can be invoked with purchase_url(:id => product.id)
  6.  
  7.   # You can have the root of your site routed by hooking up ''
  8.   # -- just remember to delete public/index.html.
  9.   map.connect '', :controller => 'site', :action => 'index', :id => nil
  10.  
  11.   # Allow downloading Web Service WSDL as a file with an extension
  12.   # instead of a file named 'wsdl'
  13.   map.connect ':controller/service.wsdl', :action => 'wsdl'
  14.  
  15.   # Named routes.
  16.   map.hub 'user', :controller => 'user', :action => 'index'  
  17.   map.profile 'profile/:screen_name', :controller => 'profile', :action => 'show'
  18.   map.groupprofile 'profile/:group_name', :controller => 'profile', :action => 'showgroup'  
  19.  
  20.   # REST resources.
  21.  
  22.   map.resources :group
  23.  
  24.   # Install the default route as the lowest priority.
  25.   map.connect ':controller/:action/:id'
  26. end