Class: TrixEditorInput

Inherits:
Formtastic::Inputs::StringInput
  • Object
show all
Defined in:
lib/formtastic/inputs/trix_editor_input.rb

Instance Method Summary collapse

Instance Method Details

#to_htmlObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/formtastic/inputs/trix_editor_input.rb', line 2

def to_html
  input_wrapping do
    editor_tag_params = {
      input: input_html_options[:id],
      class: 'trix-content'
    }

    editor_tag = template.('trix-editor', '', editor_tag_params)
    hidden_field = builder.hidden_field(method, input_html_options)

    editor = template.('div', editor_tag + hidden_field, class: 'trix-editor-wrapper')

    label_html + editor
  end
end