module CKEditor5::Rails::Context::Helpers
def ckeditor5_context(preset = nil, &block)
- Example: Basic usage with shared plugins -
Other tags:
- Yield: - The block where editor instances should be defined
Parameters:
-
preset
(PresetBuilder
) -- The preset object containing shared plugins configuration
def ckeditor5_context(preset = nil, &block) preset ||= PresetBuilder.new context_props = PresetSerializer.new(preset) tags = [] tags << ckeditor5_inline_plugins_tags(preset) tags << tag.public_send(:'ckeditor-context-component', **context_props.to_attributes, &block) safe_join(tags) end
def ckeditor5_context_preset(&block)
- Example: Creating a context with shared plugins -
Returns:
-
(PresetBuilder)
- A new preset builder instance
Other tags:
- Yield: - Block for configuring the shared plugins
def ckeditor5_context_preset(&block) PresetBuilder.new(&block) end