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].

select_month
  • References/Ruby on Rails/Rails/Classes/ActionView/ActionView::Helpers/ActionView::Helpers::DateHelper

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

2025-01-10 15:47:30
select_year
  • References/Ruby on Rails/Rails/Classes/ActionView/ActionView::Helpers/ActionView::Helpers::DateHelper

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

2025-01-10 15:47:30
select_datetime
  • References/Ruby on Rails/Rails/Classes/ActionView/ActionView::Helpers/ActionView::Helpers::DateHelper

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

2025-01-10 15:47:30
select_second
  • References/Ruby on Rails/Rails/Classes/ActionView/ActionView::Helpers/ActionView::Helpers::DateHelper

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

2025-01-10 15:47:30
select_day
  • References/Ruby on Rails/Rails/Classes/ActionView/ActionView::Helpers/ActionView::Helpers::DateHelper

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

2025-01-10 15:47:30
select_hour
  • References/Ruby on Rails/Rails/Classes/ActionView/ActionView::Helpers/ActionView::Helpers::DateHelper

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

2025-01-10 15:47:30