Philip H. wrote:
Just destroy the object like you would any other AR object.
Keep this in mind as well (an option to the acts_as_nested_set call in
- +:dependent+ - behavior for cascading destroy. If set to :destroy,
# child objects are destroyed alongside this object by
calling their destroy
# method. If set to :delete_all (default), all the child
objects are deleted
# without calling their destroy method.
Ok, destroy is what I’m looking for. Thx I can now delete all the
childs of a certain node in the database.
Is it also possible, to delete certain nodes from a nested set, when the
nested set is in an array? After an:
@project = Project.find(:all)
in the console, I have all my projects in @project. I just want to
delete now certain nodes (like id 4 and 5 or just node 6). I need this,
because I want to create certain views on the nested set. But the
destroy should only be done in this variable, not in the database.
NoMethodError: undefined method `destroy’ for #Array:0x4eef268
Even find does not work:
LocalJumpError: no block given
find' from (irb):8:ineach’
from (irb):8:in `find’