Rails 简单表格,输入类型日期不显示所有年份(仅 11)

Rails simple form, input type date not showing all years (just 11)

我有一个用户的 SimpleForm,属性是生日:

t.date "birthday"

我生成一个 SimpleForm:

<%= f.input :birthday %>

Rails 为日、月和年生成 3 个输入:

但是这些年只是从 2014 年到 2024 年。

这是现在的默认行为吗?我试过给自己添加年份的集合,但是我没有正常的输入,我有一个日期输入,被Rails分隔成3个,所以我不知道如何解决问题。

有人可以帮助我吗?

不确定默认值,但 simple_form 允许自定义年份范围(在 their README 中,顺便说一句)

  <%= f.input :date_of_birth, as: :date, start_year: Date.today.year - 90,
                              end_year: Date.today.year - 12, discard_day: true,
                              order: [:month, :year] %>