Sha256: 438bbcff606add462f2cd10b35ba9222681a51743dc1a39b1246e4104ff5a1f0

Contents?: true

Size: 593 Bytes

Versions: 3

Compression:

Stored size: 593 Bytes

Contents

class RichInput < ::Formtastic::Inputs::TextInput  
  def to_html
    editor_options = Rich.editor.merge(options[:editor] || {})
    editor_options[:width]  = options[:width] || '76%'
    editor_options[:height] = options[:height] || '200px'
    
    input_wrapping do
      label_html <<
      builder.text_area(method, input_html_options) <<
      #javascript_tag("$(function(){$('##{dom_id}').ckeditor(function() { }, #{editor_options.to_json} );});")
      "<script>$(function(){$('##{dom_id}').ckeditor(function() { }, #{editor_options.to_json} );});</script>".html_safe
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rich-0.0.3 app/inputs/rich_input.rb
rich-0.0.2 app/inputs/rich_input.rb
rich-0.0.1 app/inputs/rich_input.rb