Module: ActionView::Helpers::EnhancedDateSelectTagHelper

Included in:
InstanceTag, Tags::Base
Defined in:
lib/enhanced_date_select.rb

Instance Method Summary collapse

Instance Method Details

#enhanced_datetime_selector(options, html_options) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/enhanced_date_select.rb', line 21

def enhanced_datetime_selector(options, html_options)
  datetime = options[:value] || value(object) || default_datetime(options)

  @auto_index ||= nil

  options = options.dup
  options[:field_name] = @method_name
  options[:include_position] = true
  options[:prefix] ||= @object_name
  options[:index] = @auto_index if @auto_index && !options.key?(:index)

  EnhancedDateTimeSelector.new(datetime, options, html_options)
end

#to_enhanced_date_select_tag(options, html_options) ⇒ Object



17
18
19
# File 'lib/enhanced_date_select.rb', line 17

def to_enhanced_date_select_tag(options, html_options)
  enhanced_datetime_selector(options, html_options).enhanced_select_date.html_safe
end