// This isn't necessarily specific to toggle buttons
$(function () {

    // Change the link's icon while the request is performing
    $(document).on('click', 'a[data-remote]', function () {
        var icon = $(this).find('i');
        icon.data('old-class', icon.attr('class'));
        icon.attr('class', 'glyphicon glyphicon-refresh spin');
    });

    // Change the link's icon back after it's finished.
    $(document).on('ajax:complete', function (e) {
        var icon = $(e.target).find('i');
        if (icon.data('old-class')) {
            icon.attr('class', icon.data('old-class'));
            icon.data('old-class', null);
        }
    });

    // Redirect if not authorized
    $(document).ajaxError(function (event, jqxhr) {
        if (jqxhr.status == 401) {
            window.location.replace('/users/sign_in');
        }
    });

})
@@ -135,30 +135,8 @@
   $(
-document).on('click', 
 'a%5Bd
@@ -147,16 +147,28 @@
 remote%5D'
+).on('click'
 , functi

Fix jQuery targeting of buttons with data-remote=true to re-enable "loading" animations.