我有2个日期字段,开始日期和完成日期。我希望每个都有一个提示,就像在页面首次加载时一样,它会显示文本“请选择”。
正如您可以看到下面的代码,我已经包含了提示但它无效。
<%= f.input :year_started, prompt: "Please select", as: :date, label: "Date started", start_year: Date.today.year, end_year: Date.today.year - 100, discard_day: true, order: [:month, :year], include_blank: true, default: nil, :input_html => { :class => 'profile-date' }, :required => false %>
<%= f.input :year_finished, prompt: "Please select", as: :date, label: "Date finished", start_year: Date.today.year + 7, end_year: Date.today.year - 100, discard_day: true, order: [:month, :year], include_blank: true, default: nil, :input_html => { :class => 'profile-date' }, hint: "Or expected graduation month and year.", :required => false %>
有人可以帮助我如何在日期选择中完成此操作。感谢