Big Data/Analytics Zone is brought to you in partnership with:
DZone 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

Snippets has posted 5883 posts at DZone. View Full User Profile

Pretty Archive URLs In Typo With Routes

04.03.2005
| 11602 views |
  • submit to reddit
        Tobi posted this as a new URL scheme for Typo.

# allow neat perma urls
map.connect 'articles/:year/:month/:day', :controller  => 'articles', 
     :action => 'find_by_date', 
     :year => /\d{4}/, :day => nil, :month => nil
map.connect 'articles/:year/:month/:day/:title', :controller  => 'articles', 
     :action => 'permalink', :year => /\d{4}/