ActionView::Helpers::DateHelper

Comparison table

DateHelper helpers come in two kinds: those with a model object and those without. Apart from field_name, default and selected, Rails handles options of the same name the same way in both. In the helpers with a model object, a given field_name is overridden by method. Only the helpers with a model object use default and selected (those without one use the date or datetime argument).

When the object has no value, the helpers with a model object add selected for the current date and time, but not if include_blank or prompt is given. The helpers without one always add selected for the date or datetime argument (none for nil).

With a model objectWithout a model object<select> elements created
A combination of year, month, day, etc.
date_selectselect_dateYear, month, day
datetime_selectselect_datetimeYear, month, day, hour, minute (and second with include_seconds: true)
time_selectselect_timeHour, minute (the year, month and day are hidden <input> elements; and second with include_seconds: true)
Just one
−select_yearYear
−select_monthMonth
−select_dayDay
−select_hourHour
−select_minuteMinute
−select_secondSecond