Wednesday 15 September 2010

ruby on rails - CKEditor Carrierwave Cloudinary -


I am trying to get CeEditator to work with CarrierView and CloudReader. So far, non-CcAditator enabled visual scenes have a regular file upload field carrierview & amp; Cloudinary. However, when I try to upload a file to CKAdator and "Send it to server" I am getting a NoMethodError - the undefined method for "each image" / "jpeg": string:

This was working before the local storage configuration was removed from the CKEditor classes, but saving the file locally.

This is my current CK editor uploader:

  class CkeditorAttachmentFileUploader & lt; CarrierWave :: Uploader :: Base included Cloudinary :: CarrierWave Included CKeditor :: Backend :: CarrierWave Def extension_white_list Ckeditor.attachment_file_types End End   

File Log In:

  Start post "/ ckeditor / pictures? CkEditor = subsection_content and CKEditorFuncNum = 3 & langcode = en & amp; authenticity_token = 5Bt06UwjUD% 2FEdLFANBmZojdv8Hvn2GbQRLvC6h11Dd8% 3D" 127.0.0.1 for 2013-06 -20 15:44: 18 -0700 Processing by CKeditor :: PicturesController # Creating HTML Parameters: {"Upload" => # & Lt; ActionDispatch :: Http :: UploadedFile: 0x007ff742c77018 @ original_filename = "pic1.jpg", @ content_type = "image / jpeg", @header = "content-disposition: form-data; name = \" upload \ "; filename = \ "Pic1.jpg \" \ r \ nContentType: Image / JPEG \ r \ n ", @temphfile = # & lt; Tempfile: / var / folders / 0t / l1qc3j596v77_z3s8f2pm75w0000gn / t / rack multivarty20130620-18566- i0av53 & gt; & Gt ;, "CkAditor" = & gt; "Subsection_center", "CKEditorFunkenum" = & gt; "3", "Langcod" = & gt; "N", "Authenticity_token" = & gt; "5 BT 06 Ujjud / Adielfaanbimjed ojdv8Hvn2GbQRLvC6h11Dd8 ="} (0.4ms) started 4ms NoMethodError (0.4ms) ROLLBACK The 500 Internal Server Error - undefined Vidhi` for each ' "image / jpeg": string (GEM) cloudinary-   Current work is,  ckeditor_picture_uploader.rb  file:  
  # encoding: UTF-8 class CkeditorPictureUploader & lt; CarrierWave :: Uploader :: Base :: CKeditor to include the backend :: CarrierWave Cloudinary include :: CarrierWave # RMagick or ImageScience support: # CarrierWave :: include RMagick include CarrierWave :: include MiniMagick # CarrierWave :: ImageScience # storage type Select this uploader to use: # storage: file # Override the directory in uploaded files. # There is a sensible default for the uploader which means Mountain: # DIF store_dir # "uploads / ckeditor / pictures / # {model.id}" # and # Provide a default URL as the default if there was not File uploaded: # def default_url # "/ images / fallback /" + [version_name, "default.png"] Compact. Joint ('_') # end # as the process files are uploaded: # Process: Scale = & gt; [200, 300] # # DF Scale (width, height) ### and do some # [: Extract_sign_type, set_isize, read_dimensions]. Method Define_method: self.file.is_a, if: ("# {method} _without_cloudinary") (CarrierWave :: SanitizedFile) {} method alias_method_chain end: Send "# {method} _with_cloudinary"? Cloudinary end process: read_dimensions # create different versions of your uploaded files: version: Thumb process: resize_to_fill = & gt; [118, 100] Last version: Content processing: resize_to_limit = & gt; [800, 800] end # Add the white list of extensions that could use something like that to allow the # images to upload: def extension_white_list Ckeditor.image_file_types and end    

Try to add the following code to your CkPictureUploader / CkeditorAttachmentFileUploader:

  [: extract_content_type ,: Set_size, read_dimensions] each want to do | Method Define_method: To send "# {method} _with_cloudinary" (: "# {method} _without_cloudinary") if self.file.is_a? (CareerWave :: Sanitized File) {} end alias_method_chain method ,: Claude and    

No comments:

Post a Comment