Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Rails route lets :id be a domain name

// Named route for an id that contains . characters, such as a domain name
// eg: http://myapp/domains/foobar.com

   1  
   2  map.domain 'domains/:id', :controller => 'domains', :action => 'show', :requirements => { :id => /[a-zA-Z0-9\-\.]+/ }
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS