ruby on rails - Image upload with Carrierwave and Jcrop generates InvalidAuthenticityToken message -


I have a Rail 4 form that uses both carrier and jacre to upload an image for a carrier Have already done this successfully for a profile type. Skipping upload an avatar image or uploading images when it works fine.

But to my new look, whenever I actually add and submit a picture, I can get to make InvalidAuthenticityToken in the ActionController :: StudentProfilesController # . However, if I leave the image upload, everything becomes fine and the profile is formed.

I have read a lot of posts on this, and talk about authenticity tokens about these hidden form fields, and so far I can not find it anywhere in my sung form I'm either, or who work perfectly well on top, I have all the tokens (replaced with the X):

   & Lt; Meta content = "xxxxxxx" name = "CSRF-Token" />  

Some other important facts: jquery negligible running with avatar crop selection (which I am locally with jectrop on the image selected before uploading locally) Good deal But this is also true of other profile types where everything works correctly. One thing that is different here is that the form for "remote" is set:

  Lt;% = form_for (@student_profile, html: {remote: true, multipart: true}) what? F | & Gt%;  

In general, I do not expect anyone to debug their code. I am trying to understand that this image uploader is written in any way on my authenticity token. Am I wrong that there is no hidden authenticity in my form? If so, where can I find it? If not, how is it uploaded? Any guidance here will be greatly appreciated.

Update:

In the session dump, I also see (instead of the token with the x):

_csrf_token: "XXXXXXXX" session_id: "cb2076df134740cf2ba14e38b2ed78c6"

Show a token is a match for one of the above meta tags. Does this mean that the token is being sent?

Finally, the request parameter displays the following:

  {"utf8" => "✓", "student_profile" = & gt; {"Crop_x" = & gt; "318.54545454545456", "crop_y" ​​=> "902.5454545454546", "crop_w" = & gt; "16 98.9 90 9 90 9 1", "crop_h" => "16 98.9 90 9 90 9 1", "first_name" = & gt; "Junkie", "last_name" = & gt; "Bolton", "Alias" = & gt; "Zack", "date_of_birth" = & gt; "", "Avatar" => # & Lt; ActionDispatch :: Http :: UploadedFile: 0x007fb9101c1058 @tempfile = # & LT; Tempfile: / var / folders / 60 / bynswzcx6p3bx0bdr61xbtf00000gn / t / RackMultipart20140218-4819-mkwye0 & gt;, @ original_filename = "zach.jpg", @ content_type = "image / jpeg", @header = "content-nature: form data , Name = \ "student_profile [avatar] \"; filename = \ "zach.jpg \" \ r \ nContent type: image / jpeg \ r \ n "& gt;}," committed "=> gt Ancient history, but I have used Remotipart as recommended and it has worked like one:  Attraction. 


Comments