Module: FormtasticJQueryUI::Datepicker

Defined in:
lib/formtastic_jquery_ui/datepicker.rb

Instance Method Summary collapse

Instance Method Details

#datepicker_input(method, options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/formtastic_jquery_ui/datepicker.rb', line 4

def datepicker_input(method, options)
  html_options = options.delete(:input_html) || {}
  html_options = default_string_options(method, type).merge(html_options) if [:numeric, :string, :password, :text].include?(type)

  self.label(method, options_for_label(options)) <<
  self.send(:text_field, method, html_options) <<
  template.(:script, :type => 'text/javascript') do
    "  $('#\#{sanitized_object_name}_\#{method}').datepicker({dateFormat: 'yy-mm-dd'});   \n"
  end
end