Thursday, June 18, 2009

attachment_fu: No thumbnail generation (make sure you have a parent_id!)

I've been using attachment_fu to upload images in a rails application. Everything was working well except the thumbnails weren't generating. I think everyone follow's Mike Clark's excellent blog:

He doesn't mention that the parent_id is required, so I thought it was simply the id of the model to which the photo/upload was attached.

After some digging, I found a conversation here:

Turns out attachment_fu, creates a new entry for each thumbnail, then strings them together with the parent_id. So, make sure you keep the parent_id column otherwise attachment_fu silently fails to generate the thumbnails.

1 comment:

ReversedK said...

Thank you so much! Hours lost wondering why attachment_fu wasn't generating thumbnails