53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'app/helpers/core_form_helper.rb', line 53
def form_date_field(model, field, options = {})
classes = options[:classes] || %w[s12 m6 l4 xl3]
value = model.send(field)
options[:value] = value.strftime('%d %B, %Y') if value.present?
options[:type] = :text
options[:disabled] ||= false
tag_options = text_field_options(model, field, options)
tag_options[:class] = options[:date_picker_type] || 'simple-date-picker'
content_tag(:div, class: (%w[input-field col] + classes).join(' ')) do
concat(tag(:input, tag_options))
concat(form_label_tag(model, field, value, options))
end
end
|