options_for_select selected value not working
The documentation states:
(...)
options_for_select(container, selected = nil) public
(...)
(million examples)
So you shouldn't pass selected: something
, but just something
. Also, this something needs to be selected value, not text:
= f.select :user_id, options_for_select(@users.pluck(:name, :id), @projectuser.id), include_blank: true