You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Devise
I'm trying to use AJAX to send a DELETE request to a controller that
uses a before filter to authenticate the user. But even if the user is
logged in, the request via AJAX fails due to authentication issues,
and then kick the user off if he cancels the http-simple-auth dialogue
that pops up . How can I make a request to a controller to delete
something even if the controller is protected without running into
this issue?
Gary Taylor
unread,
Mar 25, 2011, 4:53:40 AM3/25/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to plataforma...@googlegroups.com
I have just had the same problem. It was related to the 'X-CSRF-Token' header in the ajax call not being present. This was due to upgrading rails, but not the rails.js file which deals with all of this. It relies on you using the csrf_meta_tag helper in the <head> of your page - this generates a couple of meta tags with the forgery protection token / value in it.