Post Meta

Bookmarks

  • Delicious
  • Digg
  • Reddit
  • Magnolia
  • Newsvine
  • Furl
  • Facebook
  • Technorati

Not sure yet.

I’ve added a simple tree via ActiveScaffold then tried to get back data.

With this code all_children method returns nil, children method returns all fine…

1
2
3
4
5
6
7
8
9
 
roots = Help.roots
roots.each do |r|
@s += r.level.to_s + ' | ' + r.name + ' | ' + r.children_count.to_s
childset = r.all_children
childset.each do |ch|
@s += ch.name
end
end

Then I found that BetterNestedSet cannot handle multiple roots in a table unless there is a new column added to the schema. In plus ActiveScaffold cannot simply move a children to another parent as simple as in acts_as_tree.

Later I’ve found that the official plugin page is deprecated (so RadRails installed automatically an older version of the plugin) , and you should look for the right version at RubyForge instead.

After all these, spending 1 day with BetterNestedSet and found heavier to use & less documented than the simple acts_as_tree I switched back to the plain old solution.



Related posts

Leave A Comment

+ -