Open Merff opened 7 years ago
@Merff do you have = csrf_meta_tags
in your layout?
@stereodenis yes, I have
@Merff but your form is not submitted by remotipart (it has no remotipart params)
@stereodenis why? how I can add this params?
I'm having this same issue.
In my case the error was from jquery handler - "onchange"
I'm facing the same problem. Any solution? @stereodenis
@pedroadame check jquery handlers, in my case problem was from handler.
@Merff I'm not using any jQuery handler. My form is displayed via AJAX in a vex (in case you don't know, is a JS modal library) dialog, and submitted via AJAX from there. Suddenly it started saying 'Invalid authenticity token', which was fixed by adding authenticity_token: true
to the form_for
, but it always process the request as HTML, then crashes on the respond_to :js
line.
Currently I'm building the form again from scratch just to see what broken it, because I cannot figure out.
@Merff I solved my issue, it turned out to be something with vex. Stopped using it, it worked flawlessly.
I am having the same issue any solution @JangoSteve ?
@vkeziah I ended up using ufujs-rails gem. Works like charm in my case with AJAX modal and file upload. In addition I use this approach to generate unique file names.
Rails 5.2.0 here. It helped me to switch from
//= require rails_ujs
to
//= require jquery_ujs
but I'm far from being sure that's a proper way to go.
Rails 5 and carrierwave I add:
and
I have the form:
The output for that form:
But when i submit form:
Why send as HTML, any ideas ?