13

I have a: has_and_belongs_to_many :friends, :join_table => "friends_peoples".

To add a friend I do: @people.followers << @friend which create the relationship and a new person profile.

Now I'd like to delete the relationship ONLY and not the person profile.

I tried @people.friends.delete(guilty.id) but it deletes the person profile and not the relationship.

Any idea?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Alextoul
  • 839
  • 3
  • 9
  • 19

1 Answers1

25

Have you tried this?

@people.friends.delete(guilty)
Michiel de Mare
  • 41,982
  • 29
  • 103
  • 134