Skip to content

Instantly share code, notes, and snippets.

@askehansen
Created October 21, 2014 14:03
Show Gist options
  • Save askehansen/6ca28ffab409a5e14797 to your computer and use it in GitHub Desktop.
Save askehansen/6ca28ffab409a5e14797 to your computer and use it in GitHub Desktop.
override rails_ujs confirm with bootbox.confirm
$.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