bechbox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-11 11:15 UTC
Weird problem with acts_as_attachment
I''m using acts_as_attachment to build a simple portfolio. Items has and belongs to many attachments, but when using this: <% for attachment in @item.attachments %> <%= attachment.id %><br/> <%= attachment.filename %><br/> <%= image_tag attachment.public_filename, :size => attachment.image_size %> <% end %> in a view I get: 1<br/> oxmo.png<br/> <img alt="Oxmo" height="536" src="/attachments/1/oxmo.png?" width="800" /> the filename is fine but the id for that image is 14, so the public_filename is all wrong! The id for the item is 1 but shouldn''t attachment.id in this case return the id of the attachment?? Thanks in advance! Mikkel Bech --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---