Sha256: 802e65ffd61f5558c0bdae99990c183393746b030ecd0a6092bb42deefce29d9

Contents?: true

Size: 569 Bytes

Versions: 7

Compression:

Stored size: 569 Bytes

Contents

class HtmlEditorInput < Formtastic::Inputs::TextInput
  def upload_enabled?
    ActiveAdmin::Editor.configuration.s3_configured?
  end

  def policy
    ActiveAdmin::Editor::Policy.new
  end

  def wrapper_html_options
    return super unless upload_enabled?
    super.merge( :data => { :policy => policy.to_json })
  end

  def to_html
    html = '<div class="wrap">'
    html << builder.text_area(method, input_html_options)
    html << '</div>'
    html << '<div style="clear: both"></div>'
    input_wrapping do
      label_html << html.html_safe
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_admin_editor-1.1.0 app/inputs/html_editor_input.rb
active_admin_editor-1.0.6 app/inputs/html_editor_input.rb
active_admin_editor-1.0.5 app/inputs/html_editor_input.rb
active_admin_editor-1.0.4 app/inputs/html_editor_input.rb
active_admin_editor-1.0.3 app/inputs/html_editor_input.rb
active_admin_editor-1.0.1 app/inputs/html_editor_input.rb
active_admin_editor-1.0.0 app/inputs/html_editor_input.rb