Magic Routing plugin

Plugin details

MagicRouting allows for the creation of more meaningful URLs than you get out-of-the-box with Rails.

Websitehttp://www.culann.com/2007/05/introducing Repositoryhttp://svn.mypulllist.com/svn/ext/magic_routing Author Ben Scofield Tags map, route LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.mypulllist.com/svn/ext/magic_routing

Route:

map.username 'person/:username', :controller => 'people', :action => 'show'
map.id       'person/:id',       :controller => 'people', :action => 'show'


Use:

<%= url_for username_url(@person) %> => 'person/foo'
<%= url_for id_url(@person) %>       => 'person/123'

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, about 1 year ago