Module: EacRailsUtils::CommonFormHelper::FormBuilder::DateField

Included in:
EacRailsUtils::CommonFormHelper::FormBuilder
Defined in:
app/helpers/eac_rails_utils/common_form_helper/form_builder/date_field.rb

Instance Method Summary collapse

Instance Method Details

#date_field(field_name, options = {}) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/eac_rails_utils/common_form_helper/form_builder/date_field.rb', line 7

def date_field(field_name, options = {})
  field_options = options.extract!(:use_month_numbers, :use_two_digit_numbers,
                                   :use_short_month, :add_month_numbers, :use_month_names,
                                   :month_format_string, :date_separator, :start_year,
                                   :end_year, :discard_day, :discard_month, :discard_year,
                                   :order, :include_blank, :default, :selected, :disabled,
                                   :prompt, :with_css_classes)
  field(field_name, options) do
    @helper.(:div, @form.date_select(field_name, field_options),
                        class: 'form-control-complex')
  end
end