How to configure CKEditor in Rails 3.1 (gem + Asset Pipeline)

后端 未结 5 519
温柔的废话
温柔的废话 2021-01-02 05:31

I\'ve successfully configured the ckeditor gem from https://github.com/galetahub/ckeditor on my Rails 3.1 app. My problem now is that I can\'t figure out how to configure th

5条回答
  •  执笔经年
    2021-01-02 06:21

    For Ckeditor gem v > 4.0

    1. Add following in application.js
     //= require_tree ./ckeditor
    
    1. Add a config.js in app/assets/javascript/ckeditor

    Sample config.js

    if(typeof(CKEDITOR) != 'undefined')
    {
      CKEDITOR.editorConfig = function(config) {
        config.uiColor = "#AADC6E";
        config.toolbar = [ [ 'Source', 'Bold' ], ['CreatePlaceholder'] ];
      }
    } else{
      console.log("ckeditor not loaded")
    }
    

提交回复
热议问题