var ready = function() {

  updateGroupCount();
  updateListing();

  $(".group-dropdown, .neighborhood-dropdown").change(function() {
    updateListing();
  });

  function updateListing() {
    var kind = $(".group-dropdown").val();
    var neighborhood = $(".neighborhood-dropdown").val();

    $(".group-tile").show();
    if (kind != "all") {
      $(".group-tile").not("." + kind).hide();
    }
    if (neighborhood != "all") {
      $(".group-tile").not("." + neighborhood).fadeOut("fast");
      $(".dropdowns-tile span").fadeOut("fast"); 
    } else {
      $(".dropdowns-tile span").fadeIn("fast");
    }
    updateGroupCount();
  }

  function updateGroupCount() {
    var groupCount = $(".group-tile").filter(function() {
      return $(this).css("display") !== "none";
    }).length;
    if (groupCount === 1) {
      $(".group-count").text("Displaying " + groupCount + " group");
    } else {
      $(".group-count").text("Displaying " + groupCount + " groups");
    }
  }

  // Join group button logic
  $(".group-tile button").click(function(event) {
    event.preventDefault();
    event.stopPropagation();
    $button = $(this);
    if ($button.hasClass("is-member")) {
      $button.removeClass("is-member");
      $button.removeClass("remove-member");
      $button.text("Join Group");

      var blahUrl = "/groups/" + $button.attr("value") + "/leave";
      alert(blahUrl);

    } else {
      $button.addClass("is-member");
      $button.text("You Have Joined");

      $.ajax({
        type: "PUT",
        url: "/groups/" + $button.attr("value") + "/join"
      });

    }
  });

  $(".group-tile button").hover(function() {
    $button = $(this);
    if ($button.hasClass("is-member")) {
      $button.addClass("remove-member");
      $button.text("Remove Membership");
    }
  },
  function() {
    if ($button.hasClass("is-member")) {
      $button.removeClass("remove-member");
      $button.text("You Have Joined");
    }
  });

};

$(document).ready(ready);
$(document).on("page:load", ready);

@@ -1310,21 +1310,50 @@
     
-var blahUrl =
+$.ajax(%7B%0A        type: %22PUT%22,%0A        url:
  %22/g
@@ -1398,29 +1398,16 @@
 ave%22
-;
 %0A      
-alert(blahUrl
+%7D
 );%0A%0A

Fix silly error