Answer the question
In order to leave comments, you need to log in
Preventing CSRF with protect_from_forgery?
Good afternoon, in the ApplicationController, from which all other controllers in my application are inherited, I did:
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :null_session
...
end
protect_from_forgery with: :exception
protect_from_forgery with: :exception
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question