selectタグを使用して性別モデルを表示しようとしています。ここに私のモデル
Customer Gender
ID Id
First Customer_id
Last description
Email
Password
Customer
has_one :gender
Gender
belongs_to :customer
ここで私の選択タグatm
<%= collection_select(:gender, :id, Gender.all, :id, :description) %>
しかし、代わりに次のエラーが表示されます
NoMethodError in Customers#edit
Showing /home/jean/rail/map/app/views/customers/_general.html.erb where line #23 raised:
undefined method `id' for []:Array
Extracted source (around line #23):
20:
21: <%= #collection_select(:gender, :description, @genders, :id, :description)
22: %>
23: <%= collection_select(:gender, :id, Gender.all, :id, :description) %>
24:
25: <div class="customer_edit_name">
26: <%= f.label "Birthday" %>