Rubyisms In Rails
Posted by Jacob Harris Tue, 25 Apr 2006 17:44:00 GMT
In an apparently blatant attempt to be more like Amy Hoy, I’ve decided it’s time I did some Intro to Rails writing. Tonight I’m going to be giving a little talk on what I’m calling Rubyisms as seen in Ruby on Rails. I think one of the things that makes Rails so cool is how it is built upon some of the best aspects of Ruby’s style: duck typing, symbols, blocks, and metaprogramming. And yet, I think many newcomers to Rails don’t really notice some of the magic going on behind such simple declarations as
<% 30.minutes.from_now %>or more complicated Rails cases like
class Review < ActiveRecord::Base
belongs_to :article
validates_presence_of :author
endMy humble little slideshow goes out to those Rails newcomers hacking code to look like PHP or Java. The conceit is to use some sample Rails code as starting points for deeper explorations into some of the Ruby coolness lurking inside Rails. This is a nice little look under the hood, but I hope it will educate people new to Rails on how to embrace Ruby style for cleaner and cooler code.
I’m posting the slides early for some last minute feedback and I might update these files if any other errors are found. I’d like to thank NYC.rb compatriots Sebastian Delmont, Ryan Raaum, Trotter Cashion, and David Black for their help and corrections as well.
The presentation itself is two parts. I’m releasing it here in two style. The light version is stripped of interstitial chapter screens and is a lot easier on the bandwidth:
- PDF Version
- Flash Version (Note: Flash version is cutting off bottoms of some slides)
If you like what you see there and want to get the version I’m presenting with images, the full 2MB PDF dump is also available:
Anyhow, I hope you enjoy my little presentation, and as always feedback and corrections are welcome in the comments.
Update (8/2/06)
This presentation is now available for sale as a digital shortcut from Informit (54 pages, $9.99). Please see my Rubyisms Redux for a small pitch and purchasing links. Thank you!

Oh Em Gee! There can be only one!!
Great stuff, thanks for putting this out there!
Awesome! Thanks a lot!
Very nice work Jacob! You may not be Amy Hoy (sorry, you know), but this is very well done. Maybe you could be Amy’s super-hero sidekick.
yayness!!
omgwtfbbq
this ajax thing is neat-o
i could do this all day long