# Displaying an acts\_as\_tree tree?

**URL:** <https://www.ruby-forum.com/t/displaying-an-acts-as-tree-tree/134599>\
**Category:** Rails\
**Created:** [April 12, 2008, 6:04pm UTC](https://www.ruby-forum.com/t/displaying-an-acts-as-tree-tree/134599 "2008-04-12T18:04:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/58f4c7/32.png) [@Ilya](https://www.ruby-forum.com/u/Ilya)\
**Post date:** [April 12, 2008, 6:04pm UTC](https://www.ruby-forum.com/t/displaying-an-acts-as-tree-tree/134599/1 "2008-04-12T18:04:37Z")

</div>

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(", ")  
end

what am i doing wrong?

---

<div class="post-metadata">

**Author:** ![Ilya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/58f4c7/32.png) [@Ilya](https://www.ruby-forum.com/u/Ilya)\
**Post date:** [April 13, 2008, 8:02pm UTC](https://www.ruby-forum.com/t/displaying-an-acts-as-tree-tree/134599/2 "2008-04-13T20:02:18Z")

</div>

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).

-Kyle
