2013-09-21 56 views
0

我有三种模式。积极记录通过烦恼

class Location < ActiveRecord::Base 
    attr_accessible :description 
    belongs_to :user 
    has_many :zones 
    has_many :iteractions, :through => :zones 
end 

class Zone < ActiveRecord::Base 
    attr_accessible :description 
    belongs_to :location 
    has_many :iteractions 
end 

class Iteraction < ActiveRecord::Base 
    attr_accessible :count, :itime 
    belongs_to :zone 
    belongs_to :location, :through => :zone 
end 

所以我尝试安装rails_admin 是对我说:“未知键:通过(参数错误)”

哪里是错误?

回答

3

A belongs_to协会不能有:through选项。相反,您可以使用has_one :location, :through => :zone