开发者

Is it possible to use Paperclip for atacching existing files to a model?

I have a bunch of files in the server an开发者_运维技巧d I want to link them to a model with paperclip, since I want to generate the thumbnails and save their info in the database, just as if I uploaded with a form.

Is it possible to use a console command passing the file paths for generating the Paperclip Model?


There is a rake task (alt link) that shows how to accomplish what you want to do using fixtures. It should be easy to adapt to your needs.

It looks to be as simple as setting the file on your model to the full path to the file, and calling reprocess! See the link for full details

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜