TreeView Control

I am just learning RubyRails.....

I am simply trying to add a tree view control. I want to use the YUI
treeview control.

Here is my code

<% for tax in @taxonomies%>
     <%=tax.parent-%> <%=tax.description-%> <br>
              <script type="text/javascript">
<% end %>

I have a javascript that will add a node. My question do I
pass the data I get from the ruby database loop
to the javascript?