# Simple Tree view code required

**URL:** <https://www.ruby-forum.com/t/simple-tree-view-code-required/161178>\
**Category:** Rails\
**Created:** [February 24, 2009, 7:06am UTC](https://www.ruby-forum.com/t/simple-tree-view-code-required/161178 "2009-02-24T07:06:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [February 24, 2009, 7:06am UTC](https://www.ruby-forum.com/t/simple-tree-view-code-required/161178/1 "2009-02-24T07:06:42Z")

</div>

Hi all,

Being a newbie in Ruby, I’m really fed up trying almost all the  
available tree examples in net like YUI Tree, dhtmlxTree, LiveTree in  
vain. None of them worked for me.  
Could anyone please give me a simple example (preferably end-to-end) of  
Tree view?  
Requirements: 3 levels of items, Data may be fetched from more than 1  
table.

Please help me…

Tony P.

---

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [February 24, 2009, 8:15am UTC](https://www.ruby-forum.com/t/simple-tree-view-code-required/161178/2 "2009-02-24T08:15:34Z")

</div>

What didn’t work about them? What was lacking?

On Feb 23, 10:06 pm, Tony P. \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![tnyplz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@tnyplz](https://www.ruby-forum.com/u/tnyplz)\
**Post date:** [February 25, 2009, 7:05am UTC](https://www.ruby-forum.com/t/simple-tree-view-code-required/161178/3 "2009-02-25T07:05:21Z")

</div>

Eric wrote:

> What didn’t work about them? What was lacking?
> 
> On Feb 23, 10:06ï¿½pm, Tony P. \<rails-mailing-l…@andreas-

Hi Eric,

Thanks for your response.

For instance, I was blindly following Sonjaya Tandon’s wonderful doc  
(1). It gave me no error and no result as well (just a blank area  
instead of tree list). So is the case with Christopher Haupt’s doc (2).  
I do know, issue is with me, but fail to identify.

It would be very helpful if you can give me a simple working example, be  
static data (say, Array).

1. 

[http://sonjayatandon.com/07-2006/how-to-integrate-a-yui-tree-with-rails/](http://sonjayatandon.com/07-2006/how-to-integrate-a-yui-tree-with-rails/)  
2.  
[http://www.buildingwebapps.com/articles/6415-using-yahoo-s-user-interface-library-treeview](http://www.buildingwebapps.com/articles/6415-using-yahoo-s-user-interface-library-treeview)

Thanks & regards,

Tony P.
