Skip to content

Instantly share code, notes, and snippets.

@prasofty
Created April 25, 2012 06:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save prasofty/2487410 to your computer and use it in GitHub Desktop.
Save prasofty/2487410 to your computer and use it in GitHub Desktop.
Disable remote links after click in rails 3
$('a[data-remote=true]').live('ajax:before', function () {
if ($(this).attr('ajax-loading')) {
return false;
} else {
$(this).attr('ajax-loading', true);
}
}).live('ajax:complete', function () {
$(this).removeAttr('ajax-loading');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment