<div>you have the javascript option, or the ajax option. </div>
<div>&nbsp;</div>
<div>In javascript, it is quite straightforward: a click on something toggle the visibility of a div. It works like that:</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&lt;% for category in @categories %&gt;<br>&nbsp; &lt;div id=&quot;categories&quot;&gt;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a href=&quot;#&quot; onclick=&quot;Element.toggle('subcategories_&lt;%= <a href="http://category.name">category.name</a> %&gt;');&quot;&gt;&lt;%=&nbsp;&nbsp;<a href="http://category.name">category.name</a> %&gt;&lt;/a&gt;
<br>&lt;/div&gt;<br>&nbsp; &lt;% for subcategory in category.subcategories %&gt;<br>&nbsp; &nbsp; &nbsp; &lt;div id=&quot;subcategories_&lt;%= <a href="http://category.name">category.name</a> %&gt;&quot;&nbsp; style=&quot;display:none&quot;&gt;</div>

<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input type=&quot;checkbox&quot; /DITTO&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;%= <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://subcategory.name/" target="_blank">subcategory.name
</a> %&gt;<br>&lt;/div&gt;<br>&lt;% end %&gt;<br>&lt;% end %&gt;<br>&nbsp;</div>
<div>IMHO, ajax would be useful here only if subcategory is big. Otherwise,&nbsp;this method work fine.<br>&nbsp;</div>
<div><span class="gmail_quote">On 3/31/06, <b class="gmail_sendername">Adam Bloom</b> &lt;<a href="mailto:admanb@gmail.com">admanb@gmail.com</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Still curious about this...<br><br>-Adam<br><br>--<br>Posted via <a href="http://www.ruby-forum.com/">http://www.ruby-forum.com/
</a>.<br>_______________________________________________<br>Rails mailing list<br><a href="mailto:Rails@lists.rubyonrails.org">Rails@lists.rubyonrails.org</a><br><a href="http://lists.rubyonrails.org/mailman/listinfo/rails">
http://lists.rubyonrails.org/mailman/listinfo/rails</a><br></blockquote></div><br>