オプション指定の書き方だけで30分くらいハマったので,記録します.
あと,けっこうググってもなかなかわからなかった.
環境
Ruby version: RUBY VERSION: 2.6.3
Rails version: Rails 5.0.7.2
date_select オプションの書き方
カラム(ここでは:release_date)の後ろの{}内にオプションを書く.
new.html.erb
<%= f.date_select :release_date, {start_year: 1900, end_year: (Time.now.year)},class: 'form-control' %>
参考
https://rails.densan-labs.net/form/datetime_register_form.html
https://api.rubyonrails.org/v5.1.7/classes/ActionView/Helpers/DateHelper.html#method-i-date_select