Search code examples
jqueryruby-on-railspaperclipckeditorwysiwyg

Rails 3 use CKEditor with already existing paperclip model


I have a web application in rails 3 that already has a polymorphic paperclip model. I have attached several models to it already.

I soon realized I need a good wysiwyg editor for a text area, I installed the ckeditor gem with paperclip but it generates it's own models for ckeditor::pictures and asset.

is there a way to override what model the gem is looking for in ckeditor so I can use my existing polymorphic paperclip model with ckeditor?


Solution

  • I found that you cannot tell the gem ckeditor to use your existing paperclip model, that you must use the paperclip models it generates or not use the editor. You would then have to fight the gem by forking it and making edits to use your current and existing paperclip model.

    I would personally recommend not using ckeditor gem if you already have an existing attachments model through paperclip or carrierwave. Simply obtain the ckeditor javascript files from their website and implement the editor that way.

    You can do this by downloading the javascript files, place them in your assets/javascript directory. Then include them in your application.js