deleting children

Hello again,

What is the best way to delete all children of a parent in a controller.
For example I have restaurants with a has_many association to
boundaries. I would like to do something like this:

@restaurant.boundaries.delete_all

is it possible?

steve

What is the best way to delete all children of a parent in a controller.
For example I have restaurants with a has_many association to
boundaries. I would like to do something like this:

@restaurant.boundaries.delete_all

is it possible?

Look at collection.clear under
http://api.rubyonrails.com/classes/ActiveRecord/Associations/ClassMethods.html#M001103

steve

--Greg

Will do - thanks greg!

Gregory Seidman wrote: