Module: ActiveScaffold::Bridges::DatePicker::Helper::FormColumnHelpers

Defined in:
lib/active_scaffold/bridges/date_picker/helper.rb

Instance Method Summary collapse

Instance Method Details

#active_scaffold_input_date_picker(column, options) ⇒ Object



168
169
170
171
172
173
174
175
176
# File 'lib/active_scaffold/bridges/date_picker/helper.rb', line 168

def active_scaffold_input_date_picker(column, options)
  options = active_scaffold_input_text_options(options.merge(column.options))
  options[:class] << " #{column.form_ui.to_s}"
  value = controller.class.condition_value_for_datetime(@record.send(column.name), column.form_ui == :date_picker ? :to_date : :to_time)
  format = options.delete(:format) || :default
  datepicker_format_options(column, format, options)
  options[:value] = (value ? l(value, :format => format) : nil)
  text_field(:record, column.name, options)
end