How do I remove a single HABTM associated item without deleting the item itself?

后端 未结 2 1554
灰色年华
灰色年华 2020-12-28 12:39

How do you remove a HABTM associated item without deleting the item itself?

For example, say I have 3 Students that are in a Science class together. How do I remove

2条回答
  •  心在旅途
    2020-12-28 12:59

    If you want to delete multiple associated items you can use * and write:

    student.classes.delete(*classes_array)
    

提交回复
热议问题