Rails 4 with CKEditor - plugin (codenipet) not working

I have a problem adding plugin codesnippet to my ckeditor.

  • I added the gem 'ckeditor' to the gemfile
  • Then added this to application.js // = require ckeditor / init
  • <% = f.input: body ,: as =>: ckeditor ,: input_html => {: ckeditor => {: toolbar => 'Full'}}%> to my submission forms

Then I can use ckeditor. I can, for example, create a container div to fill it and return to ckeditor.

My problem appears when I want to add an overhead to ckeditor.

  • To use these plugins, first create a file app / assets / javascripts / ckeditor / config.js and fill it in:

    CKEDITOR.editorConfig = function( config ) {
     config.language = 'fr';
     config.uiColor = '#AADC6E';};

  • I download the plugin from ckeditor sites with all dependencies and add these files to ckeditor / plugins, and of course add config.extraPlugins = 'codesnippet' + others plugins.

  • With this I can see the icon for the codenippet, I can use it, but when I want to close that window and continue to see my ckeditor, but I can’t click on anything, and my whole site has a little white transparent cover - something like this ...

This happens for every window in ckeditor. Below I say what I am trying to solve to solve this problem: 1. I am trying to add a base path as in the documentation at https://github.com/galetahub/ckeditor

  1. I am trying 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 to turn on the turboprop, but it still doesn't work. When I removed the ckeditor folder from my app / assets / javascripts my ckedtior works fine.


source to share

1 answer

Try this instead

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




All Articles