開發時期,CarrierWave 重產不同 version 圖片

當增加不同 version 的尺寸需要對已上傳的圖片從新產生新尺寸的圖片時

1
> rails c

輸入

1
2
3
4
Attachment.all.each do |att|
att.image.recreate_versions!
att.save!
end

開發時期,CarrierWave 重產不同 version 圖片

https://andyyou.github.io/2016/02/23/carrierwave-recreate-version/

作者

andyyou(YOU,ZONGYAN)

發表於

2016-02-23

更新於

2023-12-05

許可協議