次のエラーについて助けが必要です。
未定義のメソッド「キー?」nil:NilClass の場合
テーブルにデータ関連付けを追加した後に発生しました。
class Crew < ActiveRecord::Base
has_many :Peme, :foreign_key => pemeid, :dependent => destroy
has_many :Training, :foreign_key => trgid, :dependent => destroy
has_many :Visa, :foreign_key => visaid, :dependent => destroy
has_many :Contract, :foreign_key => contid, :dependent => destroy
has_many :FlagEndorsement, :foreign_key => flgendoid, :dependent => destroy
has_many :Seminar, :foreign_key => semid, :dependent => destroy
end
Class Contract < ActiveRecord::Base
attr_accessible :contcost, :contdate, :contid, :contremarks, :conttype, :crewid
belongs_to :Crew, :foreign_key => "crewid"
end
class FlagEndorsement < ActiveRecord::Base
attr_accessible :crewid, :flgendocost, :flgendodate, :flgendoid, :flgendoremarks, :flgendotype
belongs_to :Crew, :foreign_key => "crewid"
end
class Peme < ActiveRecord::Base
attr_accessible :crewid, :pemecost, :pemedate, :pemeid, :pemeremarks, :pemetype
belongs_to :Crew, :foreign_key => "crewid"
end
Class Seminar < ActiveRecord::Base
attr_accessible :crewid, :semcost, :semdate, :semid, :semremarks
belongs_to :Crew, :foreign_key => "crewid"
end
Class Training < ActiveRecord::Base
attr_accessible :crewid, :trgcost, :trgdate, :trgid, :trgremarks, :trgtype
belongs_to :Crew, :foreign_key => "crewid"
end
class Visa < ActiveRecord::Base
attr_accessible :crewid, :visacost, :visadate, :visaid, :visaremarks, :visatype
belongs_to :Crew, :foreign_key => "crewid"
end
ペメ、研修、ビザ、資格取得、乗務員の扶養になるセミナーをしたいのですが、どうすればいいですか?