ruby on rails – How do I write a select_year backwards from today’s year? – Education Career Blog

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

= 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_signupdob'})

Leave a Comment