Created
October 21, 2014 14:03
-
-
Save askehansen/6ca28ffab409a5e14797 to your computer and use it in GitHub Desktop.
override rails_ujs confirm with bootbox.confirm
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
$.rails.allowAction = function(element) { | |
var message = element.data('confirm'); | |
if (!message) { | |
return true; | |
} | |
bootbox.confirm(message, function(result) { | |
if (result) { | |
$.rails.handleMethod(element); | |
} | |
}); | |
return false; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment