Created
August 20, 2009 12:26
-
-
Save benschwarz/171038 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $("form input[name=_method][value=delete]").parents("form").submit(function (event){ | |
| if(!confirm("Are you sure?")) { | |
| event.preventDefault(); | |
| } | |
| }); | |
| // Throw this into a rails-app with jquery present and it'll ask you before you delete something. | |
| // I'd much rather implement a "delete, then offer undo" pattern, sometimes you have to go for the quick win though. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment