opscode/supermarket — pull request #547 by raskchanky (2014-07-03 22:46:55+00:00)
Title: trackLink doesn't work with ajax

:fork_and_knife:

This fixes https://github.com/opscode/supermarket/issues/533

The root cause was that `trackLink`, which is part of Segment.IO's javascript library doesn't play well with AJAX requests. Make a note for future reference.

At some point in the future, it'd be nice to optimize those `ajax:success` callbacks to not make another request to the same page and parse the entire response body just to get the updated button state. We can likely just re-render a new button in a partial in the response from `follow`/`unfollow`.

For now though, this will fix the 404.