我有一个自我引用的关联:
has_many :households
has_many :relations, :through => :households
has_many :inverse_relationships, :class_name => 'Household', :foreign_key => 'friend_id'
has_many :inverse_relations, :through => :inverse_relationships, :source => :person我使用decent_exposure作为我的控制器:
expose(:neighbor)
expose(:neighbors)在我看来,在使用simple_form的haml中,我有:
= f.input :first_name,:label => 'First Name'
= f.input :middle_name, :label => 'Middle Name'
= f.input :last_name, :label => 'Last Name'现在我希望能够列出或输入我的“家庭”中的关系,但我没有线索
发布于 2013-01-17 23:32:03
我将此更改为一种更简单的安排,即只有一个包含多个邻居的家庭模型和一个邻居模型,而不是通过家庭将邻居链接到邻居的自引用安排
有时候越简单越好
https://stackoverflow.com/questions/14350458
复制相似问题