# How to show a hierarchical list (like Mac Finder/Explorer)

**URL:** <https://www.ruby-forum.com/t/how-to-show-a-hierarchical-list-like-mac-finder-explorer/183871>\
**Category:** Rails\
**Created:** [February 22, 2010, 6:16am UTC](https://www.ruby-forum.com/t/how-to-show-a-hierarchical-list-like-mac-finder-explorer/183871 "2010-02-22T06:16:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [February 22, 2010, 6:16am UTC](https://www.ruby-forum.com/t/how-to-show-a-hierarchical-list-like-mac-finder-explorer/183871/1 "2010-02-22T06:16:49Z")

</div>

I have a list of Groups with members and sub-groups in an unlimited  
depth.

It has the same basic structure as a directory listing in either Mac  
Finder or Windoze Explorer where the files a roughly analogous to my  
members, and the sub-dirs are analogous to my sub-groups. Just as in  
Mac Finder, I would like to have it remember the “open-ness” of the  
dirs/sub-dirs in the db so user will see it the same way on subsequent  
uses of the app.

Is there some sort of a plugin for displaying this kind of a data set in  
Rails?

If not, how would you go about designing this? I’m stuck.

thanks,  
jp

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [February 22, 2010, 6:47am UTC](https://www.ruby-forum.com/t/how-to-show-a-hierarchical-list-like-mac-finder-explorer/183871/2 "2010-02-22T06:47:43Z")

</div>

Jeff P. wrote:

> I have a list of Groups with members and sub-groups in an unlimited  
> depth.

Here’s one example that might work for you:  
[http://jquery.bassistance.de/treeview/demo/](http://jquery.bassistance.de/treeview/demo/)

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [February 22, 2010, 7:16am UTC](https://www.ruby-forum.com/t/how-to-show-a-hierarchical-list-like-mac-finder-explorer/183871/3 "2010-02-22T07:16:53Z")

</div>

Robert W. wrote:

> Jeff P. wrote:
> 
> > I have a list of Groups with members and sub-groups in an unlimited  
> > depth.
> 
> Here’s one example that might work for you:  
> [http://jquery.bassistance.de/treeview/demo/](http://jquery.bassistance.de/treeview/demo/)

Thanks Robert. This looks very interesting. I’m php-challenged, so I  
will have to study it to figure out how to adapt it to Rails. I don’t  
suppose you’ve done that before? Have any Rails demo code?

At a minimum, the notion of using

 and some fancy css gives me a  
start.

thanks,  
jp

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [February 22, 2010, 11:38pm UTC](https://www.ruby-forum.com/t/how-to-show-a-hierarchical-list-like-mac-finder-explorer/183871/4 "2010-02-22T23:38:17Z")

</div>

Jeff P. wrote:

> I have a list of Groups with members and sub-groups in an unlimited  
> depth.
> 
> It has the same basic structure as a directory listing in either Mac  
> Finder or Windoze Explorer where the files a roughly analogous to my  
> members, and the sub-dirs are analogous to my sub-groups. Just as in  
> Mac Finder, I would like to have it remember the “open-ness” of the  
> dirs/sub-dirs in the db so user will see it the same way on subsequent  
> uses of the app.
> 
> Is there some sort of a plugin for displaying this kind of a data set in  
> Rails?
> 
> If not, how would you go about designing this? I’m stuck.

Why are you stuck? 2 minutes of Google searching on implementing  
hierarchical trees in SQL would have led you to the nested-set pattern.  
Another minute would have led you to the awesome\_nested\_set plugin for  
Rails.

> thanks,  
> jp

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [February 22, 2010, 11:48pm UTC](https://www.ruby-forum.com/t/how-to-show-a-hierarchical-list-like-mac-finder-explorer/183871/5 "2010-02-22T23:48:31Z")

</div>

Marnen Laibow-Koser wrote:

> Jeff P. wrote:
> 
> > I have a list of Groups with members and sub-groups in an unlimited  
> > depth.  
> > …  
> > Is there some sort of a plugin for displaying this kind of a data set in  
> > Rails?
> > 
> > If not, how would you go about designing this? I’m stuck.
> 
> Why are you stuck? 2 minutes of Google searching on implementing  
> hierarchical trees in SQL would have led you to the nested-set pattern.  
> Another minute would have led you to the awesome\_nested\_set plugin for  
> Rails.
> 
> > thanks,  
> > jp
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

Ok, I’m a moron. I didn’t remember ever seeing one. I came here and  
searched this group for “hierarchical”. Got bupkis. Thanks much for  
making me aware of this new thing called Google. Looks very useful.  
😉

cheers,  
jp
