Module: CKEditor5::Rails::Context::Helpers

Included in:
Helpers
Defined in:
lib/ckeditor5/rails/context/helpers.rb

Instance Method Summary collapse

Instance Method Details

#ckeditor5_context(preset = nil, &block) ⇒ Object



8
9
10
11
12
13
# File 'lib/ckeditor5/rails/context/helpers.rb', line 8

def ckeditor5_context(preset = nil, &block)
  preset ||= PresetBuilder.new
  context_props = PresetSerializer.new(preset)

  tag.public_send(:'ckeditor-context-component', **context_props.to_attributes, &block)
end

#ckeditor5_context_preset(&block) ⇒ Object



15
16
17
# File 'lib/ckeditor5/rails/context/helpers.rb', line 15

def ckeditor5_context_preset(&block)
  PresetBuilder.new(&block)
end