简体   繁体   中英

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.

您可以使用:start_year选项,请参阅文档

<%= 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM