Forum: Ruby on Rails HABTM - Destroy just the relationship

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
7a5ed48939fc288a4c70778140b203f6?d=identicon&s=25 aroth (Guest)
on 2006-01-18 08:04
If I have a HABTM relationship between two models (places, pictures),
can I delete the record from the join table without also destroying the


1. << @picture
2. ).destroy

I'd want line #2 (...or something similar unless I'm way off) to destroy
the record in pictures_places only, and not anything from the other two
tables (pictures, places).

It's late. I hope that made sense. I only wanna nuke the relationship

C29d9db03853958c4de5ee6b06edd39a?d=identicon&s=25 Nicolas Buet (Guest)
on 2006-01-18 09:44
(Received via mailing list)
Try the following:

This topic is locked and can not be replied to.