Displaying an acts_as_tree tree?

The question is this, how do i display the acts_as_tree tree i have
created? I have this:

<% puts TreeItem.root.children.find(:all)%>

also i tried: (using the display_children method from the agile book.

<% display_children(root).each do |child| %>

  • <%= child.name %>

<% end %>

the method:

def display_children(parent)
puts parent.children.map { |child| child.name }.join(", ")

what am i doing wrong?

What have these options generated for you? It’s hard to know what’s
wrong unless you tell us what you’re getting (or not getting).


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs