rails/jquery-ujs — pull request #308 by ingeniarius (2013-02-20 12:24:02+00:00)
Title: Supporting button[data-remote] as replacement of button_to helper

In some cases we want to send data via AJAX with appropriate HTTP method (POST/PUT/DELETE).

We have two possibilities to reach this:
1. use "a" tag (link_to helper) with data-remote and data-method
2. use "button_to" helper.

In the first case the trouble is that user can do middle-click, then will be opened new tab in browser with correct url, but with wrong HTTP method (GET instead POST/PUT/DELETE).

In the second case the trouble is that additional markup will be generated (form, div, input...).

So this pull request will add support "button" tag with "data-remote" attribute, which solve issues with "link" and "button_to" approaches.
Also "button" tag have great ability to customization, because it can have inline html markup as opposed to "input" tag.