モデルがWine
あり、ワインには多くのVarietals
.
私はWineVarietals
モデルを持っており、そのテーブルを介してワインと品種を結合します。
accepts_nested_attributes_for :wine_varietals
モデル
を入れると、 No association found for name
wine_varietals が得られます。まだ定義されていますか?
しかし、私は自分のモデルに関連付けを持っています。
私のワインモデルは
class Wine < ActiveRecord::Base attr_accessible :name, :winery_id, :wine_varietals_attributes accept_nested_attributes_for :wine_varietals 所属先:ワイナリー has_many :wine_varietals #has_and_belongs_to_many :varietals, :join_table => :wine_varietals has_many :wine_photos has_many :ヴィンテージ
WineVarietal と Varietal モデルもあります。
行をコメントアウトするaccepts_nested_attributes_for
と、エラーはなくなります。
さまざまな形式の複数形を試しましたがwines_varietals
、wine_varietal
このエラーを取り除くことができないようです。