Routing now available in beta gems

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'

2. Replace public/.htaccess with:

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

ErrorDocument 500 /500.html

3. Add the new independent Active Support library to the default loads. For gem installations, it means adding require_gem 'activesupport' right underneath require 'rubygems' in config/environment.rb. It’ll then look like:

# Require Rails gems.
require 'rubygems'
require_gem 'activesupport'
require_gem 'activerecord'
require_gem 'actionpack'
require_gem 'actionmailer'
require_gem 'rails'

For SVN/tgz installations, it means adding vendor/activesupport/lib to the ADDITIONAL_LOAD_PATHS and add require 'active_support' under # Require Rails libraries. also in config/environment.rb. It’ll then look like:

# Followed by the standard includes.
).map { |dir| "#{RAILS_ROOT}/#{dir}" }

# Prepend to $LOAD_PATH
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if }

# Require Rails libraries.
require 'active_support'
require 'active_record'
require 'action_controller'
require 'action_mailer'

4. Add ActionController::Routing::Routes.reload somewhere in your config/environment.rb file.

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

Three Ruby on Rails programmers needed in London

Sean O’Halpin is advertising on the Rails mailing list for three Ruby on Rails programmers for work in central London, UK. Here’s the short pitch:

I am looking for 3 permanent top notch Ruby developers – 2 senior and 1 intermediate – to work in central London, UK. I head up a small group of programmers who produce business applications in-house for a large communications agency in the advertising market. Demand for our services is growing so we need to expand our team.

The requirements for the two senior positions are:

The senior programmers need 5+ years experience in a variety of languages and platforms dealing with the full project lifecycle in a variety of domains. You will be expected to gather requirements, design systems and manage a project from start to finish. You will report to me, the System Architect.

…and for the intermediate position:

The intermediate programmer will be reporting to one of the seniors and should have 3+ years experience and be confident in team leading and administrative skills. Your role will be to support the seniors and to be sysadmin for the team.

Exciting stuff. Read the full thing on the mailing list and get in contact with Sean if you’re interested.

Future Mail: Email yourself tomorrow!

Ben Sinclair has launched a pretty cool little application called FutureMail to email yourself at some specified time in the future to remind you about stuff. For people who use their inbox as a task scheduler, this is a great idea.

Rails application walk-through by Scott Baron

Scott Baron is walking through the process of creating an application “…used by a university cable television station to manage and generate schedules for their movie channels”. He’s doing it in several installments and the first two are already available. The first installment describes the background and the freshly published second installment walks through the creation of all the models in the system.

Scott promises that the next installment will focus on validations and unit tests and that the whole thing will be packaged as both HTML and PDF when its done. Great work, Scott!

Florian Weber launches

Hot on the heels of Snowdevil, Florian Weber has completed the work to relaunch German e-tailer of pregnancy.. uhm stuff.. bellybutton. The shop is part a CMS for the company behind it to manage the content on the site and part a e-commerce operation to take and process orders. And it’s very nicely designed too!

In addition to the launch, Florian has written a short retrospect of the project. He talks about not optimizing too soon, using a strong domain model, and having Damage Control do continuos integration.

The completion of bellybutton should also herald Florian’s return to active Rails development. Florian had a lot of interesting developments going in Rails before bellybutton kidnapped him for three months. We’re eagerly awaiting his return.

Joe Agliozzo is looking for a Rails developer

Joe Agliozzo is looking to hire a Rails developer for a freelance project to work on an application that will “…allow users to post local restaurants, shops, attractions etc. to the database along with reviews and ‘star’ ratings. Comments and additions to the posts by users will also be allowed.” Sounds like a fun community project.

Here’s what he’s looking for in a developer:

The developer hired wll be provided with wire frame layouts of all pages, and a feature set summary will also be provided. Architecture of the db and programming is left to the discretion of the programmer. There will be as little “reinventing the wheel” as possible. I intend to use industry standard interfaces, etc.. such as uses in posting book reviews. Please include at least one example of similar site you have done in Ruby already.

Sounds interesting to you? Get in touch with Joe at joeag [at] gte [dot] net as soon as possible.

BARRA seeks Rails developer

MSCI Barra is looking for a developer that preferably is already up-to-speed with Ruby on Rails or at least interested in getting it. It’s pretty darn cool to see a company like Barra list Ruby as a required skill and Rails as a preferred one.

The short bio on Barra:

Join BARRA, the world’s leading provider of analytical investment and trading solutions. Our products are used by many of the most prestigious investment institutions in today’s exciting global financial markets to determine investment strategies. More than 2500 organizations worldwide rely on BARRA’s unique combination of risk management software, value-added information and consulting as an integral part of their investment process.

The job posting was made to craigslist’s San Francisco East Bay Area listing, so I expect its primarily targeting locales in that area.

The rise of lighttpd as the alternative web server

Apache has long appeared to be the only viable show in town for your Rails’ web serving needs when it comes to running a production system. Of course, there has always been many others, but beside my brief fling with thttpd, I’ve never actually been terribly interested in an alternative. That was before discovering lighttpd.

Where Apache is the swiss army knife of web serving, and a great swiss army knife, lighttpd is much lighter and focused. It’s driven by a single lead developer that’s incredibly available (now where did I see that work before…) and has pretty much all the features you need to make a great web server for Rails applications.

What made me particularly interested is the strong FCGI support, which includes a built-in load balancer to have a single lighttpd process be the entry point to multiple FCGI application servers behind it. In other words, you can scale up without getting a hardware based load balancer, doing round-robin DNS, or running a web server on the application servers themselves.

Today I was playing around with a single lighttpd process playing gateway to FCGI processes on four different application servers. The flexibility that gives to plug in another server into your cluster and be running in no time at all is pretty impressive.

Conveniently enough, Routes is going to rid Rails of the mod_rewrite dependency and open up the caching framework to run without complicated rewriting rules, which in turn means that it’ll work on lighttpd (and other web servers). And I’m doing my best to make Rails friendly to lighttpd and lighttpd friendly to Rails in my experiments running Basecamp and Ta-da List on it. Jan Kneschke is doing a great job already to help push that integration tighter.

So if you’re looking at an easier way to scale your Rails application, then you might be interested in looking into lighttpd already. And you’ll certainly be interested once the early adopters have had the time to familiarize us fully with it, document the process, and adapt the software.

Jason Hoffman of TextDrive also has a great post about lighttpd in Should I consider lighttpd?

Natural selection for frameworks in Ruby vs Java

Dion Almer is pondering the difference in how the Ruby and Java communities have dealt with natural selection in web-application frameworks. About Rails, he writes:

There were various web frameworks available to a Ruby developer, and then Ruby on Rails came on the scene… How did natural selection kick in with Rails? Developers started to use it. They liked it, and the community grew and grew. As the community has grown, so has the quality of the software itself (as well as documentation).

So a case of natural selection where a popular choice emerges from the opinions and usage of many. Dion contrasts this with the “unnatural” selection in Java where the de facto champion Struts is being replaced by a committee-driven JavaServer Faces:

So, the progression has had little to do with natural selection. JSF wasn’t suddenly the best framework out there that the Java community jumped on. It was made by committee. It was funded by large corporations. And, as such, it doesn’t have the quality of a natural winner.

It’s fascinating what drives the forces of natural selection. And how it takes a long time, or doesn’t occur at all, in some communities. Or whether its even good or bad that it happens (I, surely biased, strongly believe in the good of it).

Snowdevil: First e-tailer on Rails

I’m proud to announce the launch of the first e-tailer to go life with Rails Inside: Snowdevil. Especially so because the team behind it has core contributor Tobias Luekte at the technical wheel and because the site just looks cool and sells something as cool as snowboards.

It took Tobias and crew just under four months to produce the application that KLOCs in at around 6. In addition to the launch of Snowdevil, the team is looking to extract a platform for creating shops quicker with Rails. So if you’re looking into starting a shop project on Rails, you should have a chat with Tobias and see if that’s a platform that might be right for you.

Tobias posted a post-launch announcement on his blog (also powered by Rails) where he attributes the success of the project to Ruby on Rails and their TDD/XP practices. The flattering bit about Rails:

I consider the unveiling of Rails as one of the biggest jumps in productivity the computer industry has seen since it moved from assembler to high level languages. This is the time where small businesses can compete or outperform big businesses just because of better tools. You need to be as efficient as a team? No problem! By the end of the year most companies worth a damn will use Rails or a clone of it. Be ahead of the curve.

Tobias, who is also known as xal on IRC, is certainly doing his part to further Rails as well. If you look through the changelogs, you’ll notice just how busy he has been over the past couple of months bringing the framework further.

So. Do shop your next snowboard at Snowdevil. Do talk to Tobias and crew if you’re looking to get a jumpstart on your Rails-powered shop or e-commerce project.