I doubt the backend serving my app is important, but if you care, I\'m using rack-cors with a Rails 4.0 app.
Using jQuery, I send my app a PATCH
request lik
Here is what I found to solve the issue from older SO posts to deal with csrf issues:
# In application_controller.rb
protect_from_forgery
after_filter :set_csrf_cookie
def set_csrf_cookie
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
end
protected
# In Rails 4.2 and above
def verified_request?
super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])
end