Type:
Module

Action View Date Helpers

The Date Helper primarily creates select/option tags for different kinds of dates and times or date and time elements. All of the select-type methods share a number of common options that are as follows:

  • :prefix - overwrites the default prefix of “date” used for the select names. So specifying “birthday” would give birthday[month] instead of date[month] if passed to the select_month method.

  • :include_blank - set to true if it should be possible to set an empty date.

  • :discard_type - set to true if you want to discard the type part of the select name. If set to true, the select_month method would use simply “date” (which can be overwritten using :prefix) instead of date[month].

time_select

time_select(object_name, method, options = {}, html_options = {}) Instance Public methods

2015-06-20 00:00:00
time_ago_in_words

time_ago_in_words(from_time, include_seconds_or_options = {}) Instance Public methods Like

2015-06-20 00:00:00
distance_of_time_in_words

distance_of_time_in_words(from_time, to_time = 0, options = {}) Instance Public methods

2015-06-20 00:00:00
distance_of_time_in_words_to_now

distance_of_time_in_words_to_now(from_time, include_seconds_or_options = {}) Instance Public methods

2015-06-20 00:00:00
select_minute

select_minute(datetime, options = {}, html_options = {}) Instance Public methods Returns

2015-06-20 00:00:00
datetime_select

datetime_select(object_name, method, options = {}, html_options = {}) Instance Public methods

2015-06-20 00:00:00
select_date

select_date(date = Date.current, options = {}, html_options = {}) Instance Public methods

2015-06-20 00:00:00
date_select

date_select(object_name, method, options = {}, html_options = {}) Instance Public methods

2015-06-20 00:00:00
select_time

select_time(datetime = Time.current, options = {}, html_options = {}) Instance Public methods

2015-06-20 00:00:00
select_day

select_day(date, options = {}, html_options = {}) Instance Public methods Returns

2015-06-20 00:00:00