我也有ckeditor的问题。编辑您CkeditorAttachmentFileUploader
的外观与此类似:
class CkeditorAttachmentFileUploader < CarrierWave::Uploader::Base
include Ckeditor::Backend::CarrierWave
include Cloudinary::CarrierWave
[: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 :"#{method}_without_cloudinary", method
alias_method method, :"#{method}_with_cloudinary"
end
def extension_white_list
Ckeditor.attachment_file_types
end
end
之后,您会发现另一个错误。我发现在Ckeditor::AssetResponse#asset_url
方法中,asset
对象没有重新加载,所以asset.content_url
总是 nil 从而导致错误。我这样修复它:
class Ckeditor::Picture < Ckeditor::Asset
...
def url_content
url(:content) || begin
if persisted?
reload
url(:content)
end
end
end
end
Ckeditor::AttachmentFile
如果你有它,同样适用于课堂。