rails/jquery-ujs — pull request #301 by santry (2013-01-28 14:15:14+00:00)
Title: set request Content-Type for data-remote links

This pull request sets the Content-Type header to 'application/x-www-form-urlencoded; charset=UTF-8' for Ajax requests generated for links with data-remote="true" and data-method="post".

Without this patch, no Content-Type header is included in the requests that jquery-ujs generates for these links. Tools such as capybara-webkit issue repeated warnings about these missing headers and these warnings clutter the display of test results (see https://github.com/thoughtbot/capybara-webkit/issues/260).

I've added an appropriate test that passes on Chrome, Safari, Firefox and IE 7-10.