Class: Effective::FormBuilderInputs::EffectiveStaticControl
Instance Method Summary
collapse
#field_name, #initialize, #js_options, #options, #value
Instance Method Details
6
7
8
|
# File 'app/models/effective/form_builder_inputs/effective_static_control.rb', line 6
def default_input_html
{class: 'form-control-static'}
end
|
#html_options ⇒ Object
19
20
21
22
23
|
# File 'app/models/effective/form_builder_inputs/effective_static_control.rb', line 19
def html_options
super.tap do |html_options|
html_options[:class].delete('form-control')
end
end
|
#to_html ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'app/models/effective/form_builder_inputs/effective_static_control.rb', line 10
def to_html
if value.kind_of?(String) && value.start_with?('<p>') && value.end_with?('</p>')
content_tag(:p, value[3...-4].html_safe, tag_options)
else
content_tag(:p, (value.html_safe? ? value : (value.to_s || '').html_safe), tag_options)
end
end
|