-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set request Content-Type for data-remote links #301
base: master
Are you sure you want to change the base?
Conversation
We are also seeing this issue and have resorted to patching our applications. This seems like something that should definitely be merged upstream. |
Good deal. Thanks for the test! I'll pull this in, and release a new jquery-rails gem soon. |
+1 |
👍 this would be very helpful to get out in a new release. |
+1 |
+1, this annoying stuff should be fixed 👍 /cc @JangoSteve how's it going? |
I can't get this test to fail in the old version of jquery-ujs. I think I may be missing something. |
I deleted the change to rails.js and just kept the test, ran it in Chrome, Firefox, Safari, and IE9, and the test passed on all. What browser were you running it on where it failed? |
@JangoSteve the failure happens in capybara-webkit. I didn't want to introduce that dependency into the project so I didn't include it with this pull request. |
+1 |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
what's the status on this? will it be merged?... |
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 thoughtbot/capybara-webkit#260).
I've added an appropriate test that passes on Chrome, Safari, Firefox and IE 7-10.