アイテムを関連付けに関連付けるにはどうすればよいですか。ここに例とここにモデル
-Customer
-Phone
-PhoneType
Customer Phone PhoneType
Id Id Id
First Number Description
Last Phone_Type_Id
Email isViewed
Password
...
彼が従った関係
Customer
has_many phone
accepts_nested_attributes_for :phone, allow_destroy: :true
Phone
belongs_to :customer
has_one :phone_type
accepts_nested_attributes_for :phone, allow_destroy: :true
PhoneType
belongs_to :phone
私のフォームビューがCustomer#editビューでどのように機能するかは、他のフィールドで構成される一般的なフォームをレンダリングし、その中に次のコードがあります。
<%= f.fields_for :phones do |b| %>
<fieldset>
<%= b.label :number %>
<%= b.select :PhoneType %> ## issues is here
<%= b.label :isViewed %>
</fieldset>
<% end %>
前もって感謝します!