collectiveidea / awesome_nested_set

An awesome replacement for acts_as_nested_set and better_nested_set.
MIT License
2.39k stars 491 forks source link

Creating multiple root-nodes with the view-helper #6

Closed benadler closed 15 years ago

benadler commented 15 years ago

I'm a rails-newbie trying to create multiple root nodes using a_n_s. I wasn't sure whether multiple roots are supported, but methods like "all_roots_valid?()" lead me to suspect so.

When using

<%= f.select :parent_id, nested_set_options(Storage, @storage) {|i| "#{'-' * i.level * 2} #{i.name}" } %>

in my new-view, I can select all existing nodes as parent for my new node. But I just cannot figure out how to create further root-nodes (parent_id=NULL) using this approach, because the generated