Skip to content

Instantly share code, notes, and snippets.

@arthurschreiber
Forked from gbuesing/gist:98660
Created April 22, 2009 06:57
Show Gist options
  • Save arthurschreiber/99635 to your computer and use it in GitHub Desktop.
Save arthurschreiber/99635 to your computer and use it in GitHub Desktop.
# Remove the CSRF Check for Ajax Requests.
module ActionController
module RequestForgeryProtection
def verified_request?
!protect_against_forgery? ||
request.method == :get ||
request.xhr? ||
!verifiable_request_format? ||
form_authenticity_token == params[request_forgery_protection_token]
end
protected :verified_request?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment