欢迎来到cool的博客
7

Music box

Click to Start

点击头像播放音乐
新博客链接

ckeditor与carrierwave上传图片到upyun

参考:https://github.com/nowa/carrierwave-upyun

  1. 在Gemfile中:

    gem 'carrierwave'
    gem 'carrierwave-upyun'
    
  2. 在config/initializers/carrierwave.rb中,增加:

    CarrierWave.configure do |config|
    config.storage = :upyun
    config.upyun_username = "xxxxxx"
    config.upyun_password = 'xxxxxx'
    config.upyun_bucket = "my_bucket"
    config.upyun_bucket_host = "http://my_bucket.files.example.com"
    end
    
  3. 在对应的uploader中, 使用 storage :upyun

     class AvatarUploader < CarrierWave::Uploader::Base
       storage :upyun
     end

返回列表