# Javascript help

**URL:** <https://www.ruby-forum.com/t/javascript-help/141009>\
**Category:** Rails\
**Created:** [June 20, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/javascript-help/141009 "2008-06-20T19:38:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vshyam121](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/85e7bf/32.png) [@vshyam121](https://www.ruby-forum.com/u/vshyam121)\
**Post date:** [June 20, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/javascript-help/141009/1 "2008-06-20T19:38:18Z")

</div>

Hi,  
Right now I have a bunch of rhtml files with links in  
them that you can navigate through. For example, one file has these  
category links under the finance category:

Tax  
Bills  
Banks  
etc…

The user can click on Bills for example and he will get a view of more  
category links that fall under the category of Bills:

Non-Recurring Bills  
Recurring Bills

Until the user gets to a link for Gas and Electric Bills for example,  
which  
would link to the list view for the GEBill model that I have. I should  
mention that that these links are not part of any models that I’ve  
created. They are just simple rhtml files with a bunch of \<% link\_to  
…%\> lines.

My problem is how can I make it so that the user can add category links  
at any layer. And then within that new category, allow the user to make  
more new category links…

For example, the user should be able to add a link for Properties to the  
first list of links. Then once the user clicks on that he can add more  
links within the Properties.

Is this where prototype/script.aculo.us libraries come in? Does anybody  
know of any good tutorials that could perhaps start me off on the right  
track to solving this problem?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![vshyam121](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/85e7bf/32.png) [@vshyam121](https://www.ruby-forum.com/u/vshyam121)\
**Post date:** [June 21, 2008, 3:04pm UTC](https://www.ruby-forum.com/t/javascript-help/141009/2 "2008-06-21T15:04:26Z")

</div>

Shyam Vijayakumar wrote:

> Hi,  
> Right now I have a bunch of rhtml files with links in  
> them that you can navigate through. For example, one file has these  
> category links under the finance category:
> 
> Tax  
> Bills  
> Banks  
> etc…
> 
> The user can click on Bills for example and he will get a view of more  
> category links that fall under the category of Bills:
> 
> Non-Recurring Bills  
> Recurring Bills
> 
> Until the user gets to a link for Gas and Electric Bills for example,  
> which  
> would link to the list view for the GEBill model that I have. I should  
> mention that that these links are not part of any models that I’ve  
> created. They are just simple rhtml files with a bunch of \<% link\_to  
> …%\> lines.
> 
> My problem is how can I make it so that the user can add category links  
> at any layer. And then within that new category, allow the user to make  
> more new category links…

You should use a self-referecing table to create a hierarchy of the  
sections of your site. Otherwise is really complicated to allow the  
inclusion of other \<%link\_to %\> line in your code pages. You should use  
a model for this.
