다음을 간단한 양식으로 어떻게 변환합니까?레일 4 simple_form collection_select
<%= form_for(@bill) do |f| %>
<%= f.label :location_id %>
<%= f.collection_select(:location_id, @locations, :id, :location_name,
{:selected => @bill.location_id}) %>
@locations는 where 쿼리의 결과이므로 간단한 연결을 사용할 수 없습니다. 간단한 형태에서
추가 "컬렉션 :"을 삭제 한 후 작동합니다. 단, 원하지 않는 공백을 추가합니다. – markhorrocks
@markhorrocks'include_blank => false' 옵션을 추가했습니다. – Viren
@markhorrocks'include_blank => false' 옵션을 사용하여 답변을 편집했습니다. – Viren