Skip to content

Instantly share code, notes, and snippets.

@fmiopensource
Forked from Aupajo/application.js
Created July 20, 2009 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmiopensource/150452 to your computer and use it in GitHub Desktop.
Save fmiopensource/150452 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$('.delete').click(function() {
if(confirm('Are you sure?')) {
var f = document.createElement('form');
$(this).after($(f).attr({
method: 'post',
action: $(this).attr('href')
}).append('<input type="hidden" name="_method" value="DELETE" />'));
$(f).submit();
}
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment