Ckeditor和上传图片

时间:2016-10-13 07:37:37

标签: ruby-on-rails ckeditor

在我的项目中,我使用Ckeditor和Carrierwave。一切似乎都很好,但我无法上传图片。在我的config.js文件中,我有:

CKEDITOR.editorConfig = function (config) {
  config.filebrowserFlashUploadUrl = '/ckeditor/attachment_files';
  config.filebrowserImageUploadUrl = '/ckeditor/pictures';
  config.filebrowserUploadUrl = '/ckeditor/attachment_files';
};

routes.rb我有一条路线:mount Ckeditor::Engine => '/ckeditor'。当我尝试上传图像并将其发送到服务器时,我在服务器日志中收到错误:

Started POST "/ckeditor/pictures?CKEditor=announcement_body&CKEditorFuncNum=1&langCode=en" for 127.0.0.1 at 2016-10-13 10:30:44 +0300
Processing by Ckeditor::PicturesController#create as HTML
  Parameters: {"upload"=>#<ActionDispatch::Http::UploadedFile:0x00000006c4abe8 @tempfile=#<Tempfile:/tmp/RackMultipart20161013-4806-f9y5ss.jpg>, @original_filename="Kapsen HS205.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"upload\"; filename=\"Kapsen HS205.jpg\"\r\nContent-Type: image/jpeg\r\n">, "ckCsrfToken"=>"8gAsQ8c95ik1BcS474ERHnkMsn35H0efXOjkJ2EW", "CKEditor"=>"announcement_body", "CKEditorFuncNum"=>"1", "langCode"=>"en"}
Completed 500 Internal Server Error in 23ms (ActiveRecord: 0.0ms)



NoMethodError (undefined method `process' for #<Class:0x00000006b83778>
Did you mean?  proc):

如果我按Ok按钮,则会显示一条警告消息:Image source URL is missing。 代码有什么问题?我错过了什么?谢谢。

0 个答案:

没有答案