new_image = UserImage.create(:upload => images.upload)
new_image.save
self.user_images << new_image
它将在 s3 中创建一个具有相同内容的新文件。
如何让它们指向同一个 url?
如果不可能,我应该开始打开一个问题并将它 fork 到 Paperclip 中吗?
最佳答案
你可以这样做
new_image = UserImage.create(:upload => images.upload)
if new_image.save
self.user_images = new_image.upload if new_image.upload.exists?
end
关于ruby-on-rails - 如何在不重新上传的情况下使用 Paperclip 进行克隆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8045397/