$("#<%= dom_id @writing_patent_category %>").replaceWith("<%= j render :partial => 'link_category', :collection => [@writing_patent_category] %>");
<% @writing_patent_category = ProjectCategory.new(:display => 'List') # reset for new form %>
$(".edit_writing_patent_category").replaceWith("<%= j render "form" %>")
$(".new_writing_patent_category")[0].reset();