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

Rails route lets :id be a domain name (See related posts)

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

map.domain 'domains/:id', :controller => 'domains', :action => 'show', :requirements => { :id => /[a-zA-Z0-9\-\.]+/ }

Comments on this post

nicwilliams posts on Aug 01, 2007 at 02:50
Also useful for username/logins that are OpenIDs (that is, domain names)

You need to create an account or log in to post comments to this site.


Click here to browse all 5140 code snippets

Related Posts