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.filename %>

<%= image_tag attachment.public_filename, :size =>
attachment.image_size %>
<% end %>

in a view I get:




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 in this case return the id of the attachment??

Thanks in advance!

Mikkel B.