Try the following:
@place.pictures.delete(Picture.find(picture_id))
regards
On 1/18/06, aroth <adamjroth@gmail.com> wrote:>
> If I have a HABTM relationship between two models (places, pictures),
> can I delete the record from the join table without also destroying the
> objects?
>
> IE:
>
> 1. @places.pictures << @picture
> 2. @places.pictures.find( @picture.id ).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
> record.
>
>
> Thx
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060118/99fe94bd/attachment.html