The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Routing now available in beta gems

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
David Heinemeier Hansson

Posts: 484
Nickname: webster132
Registered: Jan, 2003

Rails is an open source web-application framework for Ruby
Routing now available in beta gems Posted: Feb 14, 2005 8:28 PM
Reply to this message Reply

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
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by David Heinemeier Hansson
Latest Posts From Riding Rails

Advertisement

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

2. Replace public/.htaccess with:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /dispatch.fcgi?$1 [QSA,L]

ErrorDocument 500 /500.html

3. Add the following line to config/environment.rb underneath the three lines in # Environment-specific configuration:

Controllers = Object::Dependencies::LoadingModule.new(File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers')))

That should be it. More detailed information will follow shortly.

Read: Routing now available in beta gems

Topic: Build with -Wall dammit! Previous Topic   Next Topic Topic: to_sexp, to_c, to_ruby, too_interesting_to_pass_up

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use