Skip to content

Instantly share code, notes, and snippets.

@justinjmoses justinjmoses/.js
Created Jan 23, 2012

Embed
What would you like to do?
this.browser.clickLink(link, function(e, b, s) {
b.onconfirm(function(q){ return true; });
callback(e,b,s);
});
$('.destroy').bind('click', function(e) {
e.preventDefault();
if (confirm('Are you sure you want to delete this item?')) {
var element = $(this),
form = $('<form></form>');
form
.attr({
method: 'POST',
action: element.attr('href')
})
.hide()
.append('<input type="hidden" />')
.find('input')
.attr({
'name': '_method',
'value': 'delete'
})
.end()
.submit();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.