"The Worst Rails Code" Presentation

I’ve been through the 60 or so slides from Obie Fernandez and Rein Henrich, part of a presentation they gave at RailsConf 2008 a few weeks ago, where they were going through code snippets of bad Rails code.

Overall, I thought it was rather basic but you could still have a sensation of “the Rails way”, that is, the proper way of doing things in Rails. For example:

  • use Hash#values to get the values of a Hash in an Array
  • use Array#include? to check for aggregated objects in relationships
  • use the routes’ url creation method (i.e. [named_route]_url) as opposed to hard-coded url
  • avoid the temptation to overcharge the ApplicationController

As you see, basic stuff.


Got a comment?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: