Take a look at this, a small helper I wrote for exactly this task, describtion in the rdoc: http://pastie.caboo.se/132853
put it in lib/has_image.rb and then write your model
class Product < ActiveRecord::Base belongs_to :image include HasImage ... end