regenerate paperclip thumbnails
Paperclip is a cool new alternative to attachment_fu for uploading files in Rails.
(There’s a good tutorial on Jim Neath’s blog)
The only gotcha I’ve run into so far is regenerating thumbnails. With attachment_fu, you just re-save your models. For Paperclip, there is a rake task.
rake paperclip:refresh CLASS=YourModelName
Hopefully that saves someone ten minutes of Googling :)




Nik Wakelin
Oliver Clarke
Hey Nik,
I’ve been using Paperclip quite a bit. You can regen thumbs by calling .reprocess! On some classes I’m setting up custom widths and heights and then reprocessing the thumbs when the model is saved..
There’s some other nice stuff that isn’t well documented yet, such as setting the thumb width and height via proc, and saving the geometry as an additional column.
Not that it will effect you guys – but there’s a few gotch’yas on windows too. The plugin doesn’t work very nicely with tempfiles on Windows. You need to set binmode when you open the files, and pull a couple of other tricks..
Pretty sweet plugin though – I like it for it’s simplicity. We’ve been feeding it with swfupload.
Tim.