2
3
4
5
6
7
8
9
10
11
|
# File 'app/inputs/color_input.rb', line 2
def input(wrapper_options)
hex_code = object.try(attribute_name).presence || options.delete(:hex_code).presence || options.delete(:default).presence || default_hex_code
merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
merged_input_options.merge!(type: :color, value: hex_code)
content = ActiveSupport::SafeBuffer.new
content << content_tag(:div, input_group(hex_code, merged_input_options), class: 'input-group')
content << content_tag(:div, default_help_text)
content
end
|