Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

date_select Ruby

How do I extend the range of the date_select in Ruby?

It only goes as far as 2005 and I'd like to use it for the date of birth.

like image 499
Lilz Avatar asked Jan 12 '10 09:01

Lilz


2 Answers

You can use the :start_year option, see the documentation.

like image 80
jhwist Avatar answered Oct 04 '22 16:10

jhwist


<%= f.date_select :exp_date, :start_year=>2000,:end_year=>2030 %>

it will display 2000 to 2030 years..

if u want more you can change the :start_year and :end_year values.

like image 31
Ayaaz khan Avatar answered Oct 04 '22 16:10

Ayaaz khan