How to configure default options of "ckeditor_rails" gem

I am new to Rails., can you please guide me to how to edit the default
options of “ckeditor_rails” like normal ckeditor do. Please help me.!
Thanks in Advance.

New to Rails and you started probably with the hardest cracker by my
opinion :wink:

CK loads setting dynamical when it is loaded into browser. Which can not
be done right with assets pipeline.

If you read documentation on github you will see this:

Customize ckeditor

In order to configure the ckeditor default options, create files:



It should probably work. I don’t use this gem.

I kinda made CK work by myself and I put config files directly to public
folder (I can have multiple configs for multiple sites). Location of
configuration files can be set in javascript when object is initialized.


Hi Damjan R.,

Thank you so much for your reply, Oops, is that a cracker..?!, 

Yes I followed the gems documentation and have created files according
through the documentation,
but, they did not mention any options about how to remove
buttons(options) which are not necessary for my app. like "source, save,
new page, print, paste text, paste from’ etc.,
And I also included the scripting code

// optional config

in java file "app/assets/javascripts/application.js", I did not

understand what to replace in the place of "// optional config "

Thank you,

Or., Is there any other gem… like ckeditor…?? Please help me…!!

Hi Damjan R.,

Thank you so so so so much, you did a fantastic job, solved my 

was waiting for this solution.

Thanks & Regards,

My solution is specific to CMS I am building. My biggest cracker at the
moment is documentation :wink:

It took me about two days to crack toolbar. Although everything is in ck
documentation it is very muddy ;-(

Put this somewhere into ck_config.js

CKEDITOR.editorConfig = function( config ) {
config.toolbar_basic = [
[ ‘Save’, ‘-’, ‘Cut’, ‘Copy’, ‘Paste’, ‘PasteText’, ‘PasteFromWord’,
‘-’, ‘Undo’, ‘Redo’ ],
[ ‘Bold’, ‘Italic’, ‘Underline’,
//You may reconfigure toolbar for all sessions
config.toolbar = config.toolbar_basic;

Or comment out last line and put into ckeditor object initializer for
specific session:

CKEDITOR.replace( ‘record_body’,{height: 500, customConfig:
‘/ck/ck_config.js’, contentsCss: ‘/ck/ck_css.css’, toolbar: ‘basic’} )

This is the way I did it. How to implement it into ckeditor gem is
beyond my knowledge since I don’t use it.


Hi Damjan R.,

 Thank you so much for sharing your effort, it works superb. :)