How to assign a remote file to Carrierwave?

后端 未结 4 1546
感情败类
感情败类 2020-12-08 01:19

I have video model with the following definition:

class Video
  require \'carrierwave/orm/activerecord\'
  mount_uploader :attachment, VideoUploader
  mount_         


        
4条回答
  •  猫巷女王i
    2020-12-08 01:48

    This worked for me, with CarrierWave 0.5.8

    model.update_attributes(:remote_uploader_url => "http://path/to/image.jpg")
    

    Of course, you need to set remote_uploader_url to be attr_accessible for this.

提交回复
热议问题