Skip to content

Instantly share code, notes, and snippets.

@aeden
Created February 5, 2010 21:32
Show Gist options
  • Save aeden/296273 to your computer and use it in GitHub Desktop.
Save aeden/296273 to your computer and use it in GitHub Desktop.
connectDeleteLinks: function() {
$('ul.people').find('a.delete').live('click', function() {
var li = $(this).parent();
if (confirm('Are you sure you want to delete the person "' + li.find('span.name').text() + '"?')) {
$.ajax({
type: 'post',
dataType: 'json',
url: this.href.replace(/\/delete/, ''),
data: {'_method': 'delete'},
success: function(json) {
li.slideToggle();
}
});
}
return false;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment