Class: HtmlEditorInput

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

Instance Method Summary collapse

Instance Method Details

#policyObject



6
7
8
# File 'app/inputs/html_editor_input.rb', line 6

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

#to_htmlObject



15
16
17
18
19
20
21
22
23
# File 'app/inputs/html_editor_input.rb', line 15

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

#upload_enabled?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'app/inputs/html_editor_input.rb', line 2

def upload_enabled?
  ActiveAdmin::Editor.configuration.s3_configured?
end

#wrapper_html_optionsObject



10
11
12
13
# File 'app/inputs/html_editor_input.rb', line 10

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