CKEditor,Ruby on rails,carrierwave,如何从计算机上传图像?

时间:2016-02-12 00:21:53

标签: ruby-on-rails ruby ckeditor carrierwave

我怎样才能做到这一点?我知道我必须这样做

config.filebrowserImageUploadUrl

/ckeditor/config.js上,这里有以下一行:

config.filebrowserImageUploadUrl = '/app/uploaders/ckeditor_picture_uploader';

这是我的上传程序文件

class CkeditorPictureContentUploader < CarrierWave::Uploader::Base
  include Ckeditor::Backend::CarrierWave
  include CarrierWave::MiniMagick

  storage :file

  def store_dir
    "uploads/ckeditor/content/#{model.id}"
  end


  def extension_white_list
    Ckeditor.image_file_types
  end

end

每当我尝试上传图片时,它都会一直标记路线错误,我知道它必须是具有上传格式的东西,但我不知道它是什么。

0 个答案:

没有答案