使图片上传与Rails应用程序上的ckeditor gem一起使用

时间:2019-01-26 23:24:13

标签: ruby-on-rails rubygems ckeditor carrierwave cloudinary

我正在尝试在我的ruby on rails应用程序中实现ckeditor wysiwyg,但是我无法弄清楚是什么导致图像上传功能无法正常工作。我是Web开发的新手。有什么我想念的吗?我已按照gem github页面https://github.com/galetahub/ckeditor

中的说明进行操作

当我单击图像图标,单击上载选项卡,浏览到本地图像文件,然后单击“发送到服务器”按钮时,仍然出现以下错误。 服务器日志:

We received a request at 11:19PM on Saturday, Jan 26! Someone wants to
POST /ckeditor/pictures

The route told me to use the "Ckeditor::PicturesController" and "create" 
action.

The final params hash containing all inputs looks like this:
 # params
{
     "upload" => #<ActionDispatch::Http::UploadedFile:0x0000000005744050 @tempfile=#<Tempfile:/tmp/RackMultipart20190126-2211-31rpt5.JPG>, @original_filename="IMG_0001.JPG", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"upload\"; filename=\"IMG_0001.JPG\"\r\nContent-Type: image/jpeg\r\n">,
"ckCsrfToken" => "0pH7bvLdG1xvWWnI000LNaztmvLaNmeZugvkc2Lo"
}

Query
   (0.5ms)  begin transaction
   (0.4ms)  rollback transaction

The "Ckeditor::PicturesController#create" action defined these instance 
variables:
{
"@picture" => "#<Ckeditor::Picture:0x00000000057be698>"
}

0 个答案:

没有答案