Classic Editor

DemoController Preset Example
View on GitHub

Implementation

This example shows how to configure CKEditor 5 preset from the controller level. The preset is passed via the @preset instance variable.

def classic_controller_preset
  @preset = ckeditor5_preset do
    version '43.3.0'

    toolbar :sourceEditing, :|, :bold, :italic, :underline, :strikethrough,
            :subscript, :superscript, :removeFormat, :|, :bulletedList, :numberedList,
            :fontFamily, :fontSize, :|, :link, :anchor, :|,
            :fontColor, :fontBackgroundColor, :|, :imageUpload

    plugins :Essentials, :Paragraph, :Bold, :Italic, :Underline, :Strikethrough,
            :Subscript, :Superscript, :RemoveFormat, :List, :Link, :Font,
            :FontFamily, :FontSize, :FontColor, :FontBackgroundColor, :SourceEditing, :Essentials,
            :Paragraph, :Base64UploadAdapter

    plugins :Image, :ImageUpload, :ImageToolbar, :ImageInsert,
            :ImageInsertViaUrl, :ImageBlock, :ImageCaption, :ImageInline, :ImageResize,
            :AutoImage, :LinkImage
  end
end
<% content_for :head do %>
  <%= ckeditor5_assets preset: @preset %>
<% end %>
<%= ckeditor5_editor editable_height: 300 %>

Additional Resources