Class: CKEditor5::Rails::Hooks::Form::EditorInputBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/ckeditor5/rails/hooks/form.rb

Instance Method Summary collapse

Constructor Details

#initialize(object_name, object, template) ⇒ EditorInputBuilder

Returns a new instance of EditorInputBuilder.



6
7
8
9
10
# File 'lib/ckeditor5/rails/hooks/form.rb', line 6

def initialize(object_name, object, template)
  @object_name = object_name
  @object = object
  @template = template
end

Instance Method Details

#build_editor(method, options = {}) ⇒ Object



12
13
14
15
16
# File 'lib/ckeditor5/rails/hooks/form.rb', line 12

def build_editor(method, options = {})
  html_options = build_html_options(method, options)
  add_validation_classes!(method, html_options)
  @template.ckeditor5_editor(**html_options)
end