I somehow messed up the code.
Here's the correct version.
<ul id="category_list">
<%= render :partial => 'category', :collection => @categories %>
</ul>
<p id="add_link"><%= link_to_function("Add a category",
"Element.remove('add_link'); Element.show('add_category')")%></p>
<div id="add_cateogry" style="display:none;">
<% form_remote_tag(
:url => {:action => 'new'},
:update => "category_list",
:position => :bottom,
:html => {:id => 'category_form'}) do -%>
Name: <%= text_field "category", "name" %>
<%= submit_tag 'Add' %>
<% end %>
</div>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---