4
votes

I have a problem with adding plugin codesnippet to my ckeditor.

  1. I added gem 'ckeditor' to gemfile
  2. Next added this to application.js //= require ckeditor/init
  3. <%= f.input :body, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Full'} } %> to my view forms

Then i can use ckeditor. I can for example create div container fill it and back to ckeditor.

My problem appears when i want add codesippet to ckeditor.

  1. For use this plugins first i create app/assets/javascripts/ckeditor/config.js file and fill with this:

    CKEDITOR.editorConfig = function( config ) {
     config.language = 'fr';
     config.uiColor = '#AADC6E';};
    
  2. I download plugin from ckeditor sites with all dependencies and add this files do ckeditor/plugins and off course add config.extraPlugins = 'codesnippet' + others plugins.

  3. With this i see icon for codesnippet, i can use it but when i want close this window and continuing i see my ckeditor but i cant click on anything and on all my site is a little white transparent coating - something like this.

This happens for every appear windows in ckeditor. Below i wrtie what i try to do to solve this problem: 1. I try add my base path like in documentation on https://github.com/galetahub/ckeditor

  1. I try this solution:
in assets/javascripts/application.js

//= require ckeditor_fix        #- add this line
//= require ckeditor/init
//= require_tree .

in assets/javascripts create new file ckeditor_fix.js

var CKEDITOR_BASEPATH = '/assets/ckeditor/';

At least i try turn of turbolinks but still this dont work. When i deleted ckeditor folder from my app/assets/javascripts my ckedtior work great.

1
did you figure this out? I am trying to set up codesnippet in my rails app but am not having any success. - scientiffic
unfortunately i didn't found solution and resign with codesnippet in ckeditor. - Panczo

1 Answers

2
votes

Try this instead

<%= f.cktext_area :body, :ckeditor => {:toolbar => 'Full'} %>