Hi,
If I have a model that has_many of another table, how can I make it so that when i call that model's destroy method that it also destroys all the children? Is there a method to do this?
Currently I do it like this:
It works but I was wondering if maybe there was a better wayCode:@shop.destroy Item.destroy_all 'shop_id = ' + @params[:id]
Thanks again,
Mitch





Bookmarks