You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the same problem. With data-remote: true my form is still being submitted as 'Content-Type': 'application/x-www-form-urlencoded'.
See this example repl.it that illustrates the problem. Try and submit the form without any input and notice that www-form-urlencoded is submitted and HTML is returned, even though form has data-remote: true set.
It looks like this could be related to rails/rails#20610. Adding a format.js to the respond block fixes the return type issue (it returns JSON instead of HTML). However, the rails-ujs parser still breaks because it's expecting HTML.
I'm trying to send a form with Content-Type:application/json; I set
As it says in the documentation.
But it's always sent as Content-Type:application/x-www-form-urlencoded;
Is this a bug or is there a special undocumented gotcha such that setting data-type='json' doesn't actually send json encoded data.
The text was updated successfully, but these errors were encountered: