select, option使用時にinclude_blank(空白)
とselected(初期値)
を
同時に設定したかったができなかった。
しかし、以下のように設定したら解決した。
<%= select_tag なにか,
options_for_select(値, selected: 値),
include_blank: true,
class: "example" %>
options_for_select
設定時は、
selected
:options_for_selectの第2引数
include_blank
:select_tagの第3引数
に設定しなければならない。
それまでは、selected
もselect_tagの第3引数に設定していた。
おわり