Module: Formtastic::Inputs::Base::DatetimePickerish

Includes:
Placeholder
Included in:
DatePickerInput, DatetimePickerInput, TimePickerInput
Defined in:
lib/formtastic/inputs/base/datetime_pickerish.rb

Instance Method Summary (collapse)

Methods included from Placeholder

#placeholder_text

Instance Method Details

- (Object) default_maxlength



51
52
53
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 51

def default_maxlength
  default_size
end

- (Object) default_size

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 11

def default_size
  raise NotImplementedError
end

- (Object) default_step



55
56
57
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 55

def default_step
  1
end

- (Object) extra_input_html_options



23
24
25
26
27
28
29
30
31
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 23

def extra_input_html_options
  {
    :type => html_input_type, 
    :size => size, 
    :maxlength => maxlength, 
    :step => step,
    :value => value
  }
end

- (Object) html_input_type

Raises:

  • (NotImplementedError)


7
8
9
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 7

def html_input_type
  raise NotImplementedError
end

- (Object) input_html_options



19
20
21
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 19

def input_html_options
  super.merge(extra_input_html_options)
end

- (Object) maxlength



45
46
47
48
49
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 45

def maxlength
  return options[:maxlength] if options.key?(:maxlength)
  return options[:input_html][:maxlength] if options[:input_html] && options[:input_html].key?(:maxlength)
  default_size
end

- (Object) size



33
34
35
36
37
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 33

def size
  return options[:size] if options.key?(:size)
  return options[:input_html][:size] if options[:input_html] && options[:input_html].key?(:size)
  default_size
end

- (Object) step



39
40
41
42
43
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 39

def step
  return step_from_macro(options[:input_html][:step]) if options[:input_html] && options[:input_html][:step] && options[:input_html][:step].is_a?(Symbol)
  return options[:input_html][:step] if options[:input_html] && options[:input_html].key?(:step)
  default_step
end

- (Object) value

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/formtastic/inputs/base/datetime_pickerish.rb', line 15

def value
  raise NotImplementedError
end