Replace
<%= f.select :year_of_birth, options_for_select(valid_years), class: "" %>
With
<%= f.select :year_of_birth, options_for_select(valid_years, form_for_object_name.year_of_birth), class: "" %>
where
form_for_object_name
is the object that you are passing to your form since you didn't share the <%= form_for(?) do |f| %>
.
options_for_select
takes the second argument i.e. form_for_object_name.year_of_birth
as the selected
value.
If form_for_object_name.year_of_birth
is nil then select will default to the first value of your options i.e. 1900
in your case.