Module: CKEditor5::Rails::Context::Helpers
- Included in:
- Helpers
- Defined in:
- lib/ckeditor5/rails/context/helpers.rb
Instance Method Summary collapse
-
#ckeditor5_context(preset = nil) { ... } ⇒ Object
Creates a CKEditor context component that can be shared between multiple editors.
-
#ckeditor5_context_preset { ... } ⇒ PresetBuilder
Creates a new preset builder object for use with ckeditor5_context.
Methods included from CKEditor5::Rails::Cdn::Concerns::InlinePluginsTagsBuilder
#ckeditor5_inline_plugins_tags
Instance Method Details
#ckeditor5_context(preset = nil) { ... } ⇒ Object
Creates a CKEditor context component that can be shared between multiple editors. This allows you to define common plugins that will be available to all editors within the context.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ckeditor5/rails/context/helpers.rb', line 28 def ckeditor5_context(preset = nil, &block) preset ||= PresetBuilder.new context_props = PresetSerializer.new(preset) = [] << (preset) << tag.public_send(:'ckeditor-context-component', **context_props.to_attributes, &block) safe_join() end |
#ckeditor5_context_preset { ... } ⇒ PresetBuilder
Creates a new preset builder object for use with ckeditor5_context. Used to define shared plugins that will be available to all editors within the context. Note: Only plugins configuration is relevant for context, other settings like toolbar should be configured at the editor level.
51 52 53 |
# File 'lib/ckeditor5/rails/context/helpers.rb', line 51 def ckeditor5_context_preset(&block) PresetBuilder.new(&block) end |