Hi, i have a form where my users can register to my site. They fill in theirs birthdate in the form: birthyear, birthmonth and birthday. So i am using Range to create the select in the form like this:
= f.select(:birthmonth, options_for_select((1..12)))
But that doesnt start the single digit numbers with a zero like i want: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10 and so on..
I have even tried this but it didnt work:
= f.select(:birthmonth, options_for_select((01..12)))
Anybody that know how to get Range to start with leading zeros? or any other way to do whis so i can use it in the validation?:
validates_inclusion_of :birthmonth, :in => 1..12
Thanks, Micke