Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (23 sloc) 1.36 kb
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id =>
# You can have the root of your site routed by hooking up ''
# -- just remember to delete public/index.html.
# map.connect '', :controller => "welcome"
# Allow downloading Web Service WSDL as a file with an extension
# instead of a file named 'wsdl'
map.connect ':controller/service.wsdl', :action => 'wsdl'
# Install the default route as the lowest priority.
id_requirement = /\d+/
action_requirement = /[A-Za-z]\S*/
map.connect ':controller/:action', :action => 'list<%= suffix %>',
:requirements => { :action => action_requirement }
map.connect ':controller/:id/:action', :action => 'show<%= suffix %>',
:requirements => { :id => id_requirement,
:action => action_requirement }
Jump to Line
Something went wrong with that request. Please try again.