12
我有一個:has_and_belongs_to_many :friends, :join_table => "friends_peoples".
刪除具有一對多的關係ONLY
要添加好友我做的:@people.followers << @friend
其創造的關係,一個新的人的個人資料。
現在我想刪除關係而不是個人資料。
我試過@people.friends.delete(guilty.id)
,但是它刪除了個人資料而不是關係。
有什麼想法?
工程!很簡單!非常感謝 – Alextoul 2010-10-05 16:24:58
FYI刪除跳過回調。使用'@ people.friends.destroy(guilty)'讓回調工作。 – meatherly 2013-09-11 23:23:01