开发者

Paperclip: Is that possible to recreate a deleted thumbnail without uploading the original image again?

I use Paperclip like this:

class Asset < ActiveRecord::Base
  has_attached_file :asset, :styles => { :thumb => "80x80>开发者_运维知识库;" }, ...

When an image is uploaded, a thumbnail is created successfully.

Suppose, that for some reason, a thumbnail was deleted from the file system.

Is that possible to recreate the thumbnail without uploading the original image again ?

I tried:

Asset.find(16).save    # => true

but the thumbnail wasn't created in the file system.


Have you tried the reprocess! method? Something like

Asset.find(16).asset.reprocess!
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜