Something like this will work:
class House < ActiveRecord::Base
has_many :photos
end
class Photos
has_attachment :content_type => :image,
:storage => :file_system,
:max_size => 500.kilobytes,
:resize_to => '320x200>',
:thumbnails => { :thumb =>
'100x100>' }
validates_as_attachment
end
you will need the attachment_fu plugin. A good tutorial on
it here:
http://cl
arkware.com/cgi/blosxom/2007/02/24
On Dec 31, 3:28 pm, jvazquez <Juanvazq... gmail.com> wrote:
> Hi all, I am new to ruby and as such really new to
rails, I was
> wondering if anyone could help me out or point me in
the right
> direction. I am wanting to know the proper way to link
many pictures
> to a model "house". That way if I look up my
house, I will see all the
> pictures that are associated with it. Any help would be
greatly
> appreciated.
> Thanks
> -J
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
|