Skip to content

Instantly share code, notes, and snippets.

@jhuckabee
Created February 8, 2010 22:33
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 jhuckabee/298665 to your computer and use it in GitHub Desktop.
Save jhuckabee/298665 to your computer and use it in GitHub Desktop.
<a href="/users/1" onclick="if (confirm('Are you sure?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); m.setAttribute('value', 'delete'); f.appendChild(m);f.submit(); };return false;">Delete</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment