Unofficial CKEditor 5 Ruby on Rails integration gem. Provides seamless integration of CKEditor 5 with Rails applications through web components and helper methods.
Presets are predefined configurations of CKEditor 5, allowing quick setup with specific features. The gem includes a :default preset with common features like bold, italic, underline, and link for the classic editor.
You can create your own by defining it in the config/initializers/ckeditor5.rb file using the config.presets.define method. The example below illustrates the setup of a custom preset with a classic editor and a custom toolbar:
In order to override existing presets, you can use the config.presets.override method. The method takes the name of the preset you want to override and a block with the old configuration. The example below shows how to hide the menubar in the default preset:
Configuration of the editor can be complex, and it's recommended to use the CKEditor 5 online builder to generate the configuration. It allows you to select the features you want to include and generate the configuration code in JavaScript format. Keep in mind that you need to convert the JavaScript configuration to Ruby format before using it in this gem.