CKEditor Carrierwave Cloudinary

前端 未结 4 1799
星月不相逢
星月不相逢 2021-01-06 10:52

I\'m trying to get CKEditor to work with Carrierwave and Cloudinary. So far, non-CKEditor enabled views with a regular file upload field are working perfectly with Carrierwa

4条回答
  •  感情败类
    2021-01-06 11:33

    Ckeditor was updated so this may need to be extract_size and extract_dimensions depending on ckeditor gem version

    Commit Where it was changed: https://github.com/galetahub/ckeditor/blob/4e6d8413cc71f40d2d58ab3d0cb8dad19dd96894/lib/ckeditor/backend/carrierwave.rb

    ie:

    [:extract_content_type, :extract_size, :extract_dimensions].each do |method|
      define_method :"#{method}_with_cloudinary" do
      send(:"#{method}_without_cloudinary") if self.file.is_a?  (CarrierWave::SanitizedFile)
        {}
     end
      alias_method_chain method, :cloudinary
    end
    

提交回复
热议问题