开发者

How do I write a select_year backwards from today's year?

I understand there is a select_Year but i can't figure out how to use it:

开发者_如何学Go
= f.select_year("dob", :start_year => DateTime.now.year, :end_year => DateTime.now.year - 100 )

This is incorrect..how would you actually write this? My attribute is :dob


= f.select_year(Date.today, :start_year => DateTime.now.year, :end_year => DateTime.now.year - 100, :field_name => 'dob' )

EDIT

next one works

select_year(Date.today, {:start_year => DateTime.now.year, :end_year => DateTime.now.year - 100}, {:name => 'card_signup[dob]'})
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜