<% if !resource.errors.any? %> $("#ids_<%= resource.id %>").fadeOut(function() { $(this).remove(); }); <% end %>