select_day(date, options = {})
public
Returns a select tag with options for each of the days 1 through 31 with
the current day selected. The date can also be substituted for a
hour number. Override the field name using the :field_name option,
‘day’ by default.
Show source
def select_day(date, options = {})
day_options = []
1.upto(31) do |day|
day_options << ((date && (date.kind_of?(Fixnum) ? date : date.day) == day) ?
%(<option value="#{day}" selected="selected">#{day}</option>\n) :
%(<option value="#{day}">#{day}</option>\n)
)
end
select_html(options[:field_name] || 'day', day_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled])
end