collection_selectにclassやidなどのhtmlオプションを指定する[Rails]
Railsのcollection_selectにclassやidなどのhtmlオプションを指定する方法
// メソッドの定義 collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {}) // 実際の使い方 collection_select(:user, :title, UserTitle.all, :id, :name, { prompt: true }, { class: 'my-custom-class' })
options
とhtml_options
が別であるみたいです。