Class: TextEditorInput

Inherits:
SimpleForm::Inputs::TextInput
  • Object
show all
Defined in:
app/inputs/text_editor_input.rb

Instance Method Summary collapse

Instance Method Details

#input(_wrapper_options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'app/inputs/text_editor_input.rb', line 3

def input(_wrapper_options)
  tag_id = "#{object_name}_#{attribute_name}"
  s = template.select_tag(:dhtml_selector,
                                template.options_for_select([["Rich Text", ""],["Simple Text", "disabled"]],
                                template.cookies[:editorEnabled] == 'true' ? "" : "disabled"),
                                :class => "#{object_name}_#{attribute_name}_dhtml_selector",
                                :tabindex => '-1',
                                :onchange => "toggleEditor('#{tag_id}', this)".html_safe)
  s += template.(:div, super, class: 'editor')

end

#input_html_classesObject

Mark textarea with class for WYSIWYG editor.



16
17
18
# File 'app/inputs/text_editor_input.rb', line 16

def input_html_classes
  super.push('editor')
end