6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/simple_form_extension/inputs/color_input.rb', line 6
def input(wrapper_options = nil)
input_html_options[:class] << "colorpicker form-control"
input_html_options[:data] ||= {}
input_html_options[:data].merge!(
colorpicker: true,
format: format,
align: align
)
color = object.send(attribute_name)
content_tag(:div, class: 'input-group color', data: { :'colorpicker-wrapper' => true }) do
@builder.text_field(attribute_name, input_html_options) +
content_tag(:span, class: 'input-group-addon') do
content_tag(:i, '')
end
end
end
|