2013-09-21 136 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