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

About this user

Peter Cooperx http://www.petercooper.co.uk/

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

Snippets' routes

These routes allow URLs like tags/whatever/whatever/whatever to put 'whatever', 'whatever', and 'whatever' into the @params[:tags] array, etc.

   1  map.connect '', :controller => "posts", :action => "index"
   2  map.connect 'tags/*tags', :controller => 'tag', :action => 'show'
   3  map.connect 'user/:user', :controller => 'user', :action => 'show'
   4  map.connect 'user/:user/tags/*tags', :controller => 'tag', :action => 'show'


Pretty archive URLs in Typo with Routes

Tobi posted this as a new URL scheme for Typo.

   1  # allow neat perma urls
   2  map.connect 'articles/:year/:month/:day', :controller  => 'articles', 
   3       :action => 'find_by_date', 
   4       :year => /\d{4}/, :day => nil, :month => nil
   5  map.connect 'articles/:year/:month/:day/:title', :controller  => 'articles', 
   6       :action => 'permalink', :year => /\d{4}/
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS