以下に示すクエリを使用して、選択ボックスにデータを入力しています。
<%=f.select :acoustic, options_for_select(User.includes(:roles).where(
:roles => {:description => "Acoustic"}).collect{|u|[[u.name,u.surname].join(" ")]}) %>
ただし、選択ボックスのデフォルトオプションを空の文字列にします。私はもう試した
<%=f.select :acoustic, options_for_select(["", User.includes(:roles).where(
:roles => {:description => "Acoustic"}).collect{|u|[[u.name,u.surname].join(" ")]}]) %>
しかし、ボックスに(必要に応じて)空白が入力されるため、これは機能しないようですが、クエリから最初の結果を取得し、それを配列ブラケットに入れるだけです。助けてくれてありがとう