<% if @category.errors.any? %>
  $("#categories_form").html("<%= escape_javascript(render('new')) %>");
<% else %>
  $("#categories_form").html("");
  $("#categories_list").html("<%= escape_javascript(render('categories')) %>");
<% end %>
