Module: ActionView::Helpers::TextFieldDateHelper

Included in:
ActionView::Helpers
Defined in:
lib/action_view/helpers/text_field_date_helper.rb

Instance Method Summary collapse

Instance Method Details

#date_text_field(object_name, method, options = {}, html_options = {}) ⇒ Object

These two handle an object with a method that returns a Date or Time object.



9
10
11
# File 'lib/action_view/helpers/text_field_date_helper.rb', line 9

def date_text_field(object_name, method, options = {}, html_options = {})
  InstanceTag.new(object_name, method, self, options.delete(:object)).to_date_text_field_tag(options, html_options)
end

#text_field_date(date = Date.current, options = {}, html_options = {}) ⇒ Object

These two handle Date and Time objects.



18
19
20
# File 'lib/action_view/helpers/text_field_date_helper.rb', line 18

def text_field_date(date = Date.current, options = {}, html_options = {})
  DateTimeSelector.new(date, options, html_options).text_field_date
end

#text_field_time(time = Time.current, options = {}, html_options = {}) ⇒ Object



22
23
24
# File 'lib/action_view/helpers/text_field_date_helper.rb', line 22

def text_field_time(time = Time.current, options = {}, html_options = {})
  DateTimeSelector.new(time, options, html_options).text_field_time
end

#time_text_field(object_name, method, options = {}, html_options = {}) ⇒ Object



13
14
15
# File 'lib/action_view/helpers/text_field_date_helper.rb', line 13

def time_text_field(object_name, method, options = {}, html_options = {})
  InstanceTag.new(object_name, method, self, options.delete(:object)).to_time_text_field_tag(options, html_options)
end