Class: RichInput

Inherits:
Formtastic::Inputs::TextInput
  • Object
show all
Defined in:
app/inputs/rich_input.rb

Instance Method Summary collapse

Instance Method Details

#to_htmlObject



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

def to_html

  editor_options = Rich.getEditorOptions(options[:config])

  input_wrapping do
    label_html <<
    builder.text_area(method, input_html_options) <<
    #javascript_tag("$(function(){$('##{dom_id}').ckeditor(function() { }, #{editor_options.to_json} );});")
    # doing this might be insecure?
    "<script>$(function(){$('##{dom_id}').ckeditor(function() { }, #{editor_options.to_json} );});</script>".html_safe
  end
end