Sunday, 25 August 2013

Rails 4 Ckeditor error, setting toolbar

Rails 4 Ckeditor error, setting toolbar

I get a "wrong number of arguments (4 for 0)" error when using the code
below which is how it is described in the current docs for the ckeditor
gem
= f.cktext_area :content, :class => "ckeditor", :ckeditor => {:toolbar =>
"mini"}
using the code below works but I'm unable to set the toolbar to 'mini' (
ckeditor appears on the page but with the full toolbar )
= f.text_area :content, :class => 'ckeditor',:ckeditor => {:toolbar =>
"mini"}
how do I correctly add any settings?

1 comment:

  1. Try to enclose it in double brackets, like this:
    =f.cktext_area :body, rows: 15, cols: 100, :ckeditor => {:toolbar => [['Bold']] }
    I don't believe 'mini' is defined. I don't know where they got that from. See here for customization instructions: http://docs.ckeditor.com/#!/guide/dev_toolbar
    I believe you have to create a custom config.js to actually customize it, as it's impractical to put all your button names into the HAML.

    ReplyDelete