This post originated from an RSS feed registered with Ruby Buzz
by David Heinemeier Hansson.
Original Post: Routing now available in beta gems
Feed Title: Riding Rails
Feed URL: http://sedoparking.com/search/registrar.php?domain=®istrar=sedopark
Feed Description: The knowledge diff for all things Rails
Routing is the new name for what was previously known as Directions. The move of responsibility from mod_rewrite and into Rails. This project is now good enough to have moved off the branch it was growing on and into the trunk and beta gems. This also means, however, that the trunk and the beta gems are currently not directly backwards compatible with existing applications.
We’re going to make sure that the migrating documentation is superb for release, but if you’re too impatient, here are the few steps you need to take on applications that doesn’t use custom URLs (those will be a bit more cumbersome to port):
1. Create config/routes.rb with the following content:
ActionController::Routing::Routes.draw do |map|
# Add your own custom routes here.
# The priority is based upon order of creation: first created -> highest priority.
# Here's a sample route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# Install the default route as the lowest priority.
map.connect ':controller/:action/:id'
end