8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/simple_form_extension/inputs/date_time_input.rb', line 8
def input(wrapper_options = nil)
input_html_options[:class] << "form-control"
input_html_options[:data] ||= {}
input_html_options[:data].merge!(type_specific_option)
if (value = object.send(attribute_name).presence) && !input_html_options.key?(:value)
format = _translate("#{ input_type }.format.rails")
input_html_options[:value] = I18n.l(value, format: format)
end
content_tag(:div, class: 'input-group') do
@builder.text_field(attribute_name, input_html_options) +
content_tag(:span, class: 'input-group-btn') do
content_tag(:button, type: 'button', class: 'btn btn-default datetimepicker-trigger') do
content_tag(:i, '', class: "fa fa-#{ icon }")
end
end
end
end
|