From the monthly archives:

August 2009

It seems that a lot of people are confused about what to do when it comes to requiring authentication for their Ruby on Rails application. Here are a few links that helped me figure things out.

[click to continue…]

{ 13 comments }

One of the most powerful aspects of Ruby on Rails are the associations we can create between two classes. It is immensely convenient to be able to call person.posts rather than doing a SQL statement to find all of the posts with a person_id of X.

Sometimes, we have instances where the associations could be with multiple classes. For example, if we have a Page class that can be associated with an HTMLAdvertisement or an ImageAdvertisement. In that case, we really want to be able to call @page.advertisement to get the advertisement. This is where polymorphic associations come in.

Polymorphic associations allow us to associate a single attribute of the class to any number of specified classes. Here are the Page, HtmlAdvertisement, and ImageAdvertisement models:

[click to continue…]

{ 4 comments }

RMagick is the Ruby wrapper for ImageMagick—the open source API for image manipulation. RMagick is used for graphing with the Gruff gem and many other things in Ruby and Ruby on Rails.

Installing RMagick on Mac OS X is pretty simple, but not as simple as typing gem install rmagick but pretty close.

[click to continue…]

{ 1 comment }

I’ve recently been hearing a lot about Edge Rails—the development version of Ruby on Rails— and decided that I wanted to try out all of the cool stuff that’s soon going to be at our fingertips. So, I checked out the source for Edge Rails and realized that other people probably will want to do the same. So, here’s how you do it.

[click to continue…]

{ 8 comments }

For those that followed Rails Envy, you’re probably aware that Gregg Pollack and Jason Seifer have discontinued the Rails Envy podcast. The Rails Envy website is still there, for those who are checking it out as one of the 9 Resources for New Ruby on Rails Developers.

I was considering starting my own podcast to take its place, but Gregg Pollack informed me that he was planning to start a new podcast. It’s now up at http://ruby5.envylabs.com and available on iTunes.

[click to continue…]

{ 4 comments }

Last month, I posted 9 Ways to Use Rails Metal. This is the seventh way to use Rails Metal.

A week ago, I posted Ruby on Rails: Polymorphic Associations with Mixin Modules which included an example of tracking impressions on different objects.

[click to continue…]

{ 0 comments }


Learn how to create a simple plugin using Ruby on Rails. This video will teach you how to turn a view helper into it’s own plugin, and extend the ActionView::Base.
Download 13 MB
Download (iphone & ipod)

{ 8 comments }