Shopify/turbograft — pull request #17 by qq99 (2014-09-26 19:29:46+00:00)
Title: Adding remote-method

This provides functionality similar to rails version of `link_to` for methods other than `GET`, allowing you to query methods on different endpoints, and partial page replacing different refresh keys depending on the response status

It exposes a few events:
- `turbograft:remote:start`: before XHR is sent
- `turbograft:remote:always`: always fires when XHR is done
- `turbograft:remote:success`: always fires when XHR was successful
- `turbograft:remote:fail`: always fires when XHR failed
- `turbograft:remote:fail:unhandled`: fires after the above event, but when we didn't partially replace anything with `refresh-on-error`

Each event also is sent with a copy of the `xhr` in case you need to look at anything in there