Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Activeadmin. WARNING: Can't verify CSRF token authenticit. #6

Closed
Begler opened this issue Apr 18, 2012 · 6 comments
Closed

Activeadmin. WARNING: Can't verify CSRF token authenticit. #6

Begler opened this issue Apr 18, 2012 · 6 comments
Labels

Comments

@Begler
Copy link

Begler commented Apr 18, 2012

activeadmin + tinymce-rails + tinymce-rails-imageupload.
Image is stored and displayed in the window of TinyMCE, but when you try to save the database, generates "WARNING: Can't verify CSRF token authenticit". Thank you.

@PerfectlyNormal
Copy link
Owner

Oh, sorry about that. I disabled CSRF verification in my controller when I was just testing the functionality, and forgot to try with it enabled.

Pushed an attempt that works for me (3e2dbd4). Does it work for you now?

@PerfectlyNormal
Copy link
Owner

Oh, and this of course requires that your layout contains <%= csrf_meta_tag %> somewhere. If you don't use the CSRF protection, add a skip_before_filter :verify_authenticity_token in the controller this form submits to

@Begler
Copy link
Author

Begler commented Apr 23, 2012

Ok, 3e2dbd4 works fine. Thank you.

@Begler Begler closed this as completed Apr 23, 2012
@PerfectlyNormal
Copy link
Owner

Great. I'll see if I can get a new gem out tomorrow

@anguyen-elc
Copy link

If you use following line in your main js file:
//= require tinymce
You will see the error message
tinyMCE.$ is not a function
in the JS console and the uploader will not work!
My solution is to use:
//= require tinymce-jquery
and it seems to work well!
Can you test it and make it run again?

@PerfectlyNormal
Copy link
Owner

Hm, yeah. I've never tried using TinyMCE without jQuery, so I just assumed it was always available. I'll take a look as soon as I get some time and see if I can get it working without jQuery.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants