Rails-doc.org is my new Rails Reference

Rails-doc.org When working with a framework as large as Ruby on Rails its necessary to have a reference close by for… well just about everything. Until recently I was a big fan of gotAPI.com because I really appreciated the Ruby and Rails reference tied together. However, the Javascript autocomplete on their search box is broken in Firefox 3 so I decided to try the new Rails reference site, Rails-doc.org.

Rails-doc.org is an fairly ambitious project to create a community driven Rails documentation site. Basically they let users sign up and contribute notes to the existing Rails documentation. This certainly has the potential to be very useful, especially for new Rails hackers because sometimes the people who have been around the framework for a while just take things for granted.

Take the documentation for strftime in the Date class for example. There is no documentation listed for that method. Despite the fact that you clearly need documentation of the strftime options in order to use that method. Instead you have to know to look under strftime in the Time class for the documentation. While this is an example specific to Ruby documentation, these are the kinds of obvious problems that a community documentation website can help solve.

Right now Rails-doc.org has only been live for a month the so amount of community documentation feels very low. In the mean time I’ll be using the site for the official documentation that is already in place. Plus its the best looking rendering of the Rails documentation site out there. The Nodeta guys did a good job with the design. They also have a nice looking blog.

It will be interested to see how many of the notes contributed to Rails-doc get ported to the official Rails documentation. This certainly feels like the easiest and most straightforward way to contribute to Rails documentation and I can see it becoming a testing ground for future contributions to the official docs.

Eager Loading with Ultrasphinx

Ultrasphinx is a great Rails plugin that wraps around the Sphinx full-text search engine. I am using Ultrasphinx to handle search queries on a personal project I’m working on and I ran into a situation where I wanted to eager load associated models for my search results. The method for doing this is not well documented so I’m going to step through how to add eager loading to your Ultrasphinx searches.

I am actually going to show two ways to do this. The first is the way that Evan Weaver, the creator of Ultrasphinx, recommends and the second way is the create a simple plugin that extends the Ultrasphinx plugin. The second way is my favorite because it provides the cleanest integration in my opinion but I’m going to demonstrate both methods so you can choose for yourself.

Read more

Rails has a low learning curve? Hardly. You need to know Ruby

Ruby Required

Ruby on Rails is often (incorrectly) billed as the framework that makes web development easy. Unfortunately a lot of people take this to mean “Anyone can make a web site with Rails” or “You can get started with Rails in 15 minutes“. Unfortunately neither is the case but regardless hundreds of thousands of people1 are flocking to Rails to start making a web app for everything under the sun.

These people learn in hurry that Rails is actually quite a large beast2 and jump right into working with Rails without taking time to learn the programming language that Rails uses… Ruby. Almost like Ruby doesn’t exist. If I had to guess I would say people coding Rails apps without actually knowing Ruby has inevitably lead to the Rails community’s pseudo status as a ghetto.

I must confess, I was one of the Rails coders who didn’t know Ruby when I first started with Rails. Very few people who come to Rails known Ruby due to Ruby’s limited popularity before Rails came along. For about the past 7 months I have been trudging along, learning more about Ruby every day3 and the code I write for Rails projects now is much better. Ruby programming constructs like blocks, lamba, proc, etc are fairly advanced topics that I am probably only beginning to comprehend.

Most people might think it is obvious that you would need to know a framework’s programming language before you started using the framework. Certainly you would not attempt J2EE development without first knowing Java. For some reason this has not always been the case with Rails.


  1. Instant Rails has been downloaded over 400,000 times. 

  2. The Rails Way which contains everything a Rails developer needs to know about Rails is 912 pages. 

  3. Largely thanks to Project Euler