I am trying to get CKEditor to work with Carrierwave and Cloudinary. Presently not supported CKEditor views with a regular file upload field work great with Carrierwave and Cloudinary. However, when I try to upload the file to CKEditor and "Send it to the server", I get NoMethodError - undefined method 'each' for "image/jpeg":String:
Prior to removing the local storage configuration from the CKEditor classes, it worked, but saved the file locally.
Here is my current CKEditor bootloader:
class CkeditorAttachmentFileUploader < CarrierWave::Uploader::Base include Cloudinary::CarrierWave include Ckeditor::Backend::CarrierWave def extension_white_list Ckeditor.attachment_file_types end end
Log file:
Started POST "/ckeditor/pictures?CKEditor=subsection_content&CKEditorFuncNum=3&langCode=en&authenticity_token=5Bt06UwjUD%2FEdLFANBmZojdv8Hvn2GbQRLvC6h11Dd8%3D" for 127.0.0.1 at 2013-06-20 15:44:18 -0700 Processing by Ckeditor::PicturesController#create as HTML Parameters: {"upload"=>#<ActionDispatch::Http::UploadedFile:0x007ff742c77018 @original_filename="pic1.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"upload\"; filename=\"pic1.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<Tempfile:/var/folders/0t/l1qc3j596v77_z3s8f2pm75w0000gn/T/RackMultipart20130620-18566-i0av53>>, "CKEditor"=>"subsection_content", "CKEditorFuncNum"=>"3", "langCode"=>"en", "authenticity_token"=>"5Bt06UwjUD/EdLFANBmZojdv8Hvn2GbQRLvC6h11Dd8="} (0.4ms) BEGIN (0.4ms) ROLLBACK Completed 500 Internal Server Error in 4ms NoMethodError - undefined method `each' for "image/jpeg":String: (gem) cloudinary-1.0.59/lib/cloudinary/carrier_wave/process.rb:100:in `block in transformation'
Any ideas appreciated!
UPDATE - Working configuration from Tal Lev-Ami answer
This is my current working file ckeditor_picture_uploader.rb :
# encoding: utf-8 class CkeditorPictureUploader < CarrierWave::Uploader::Base include Ckeditor::Backend::CarrierWave include Cloudinary::CarrierWave
source share