Created
June 14, 2011 09:52
-
-
Save Amitesh/1024607 to your computer and use it in GitHub Desktop.
request forgery protection in Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# While using curl post call then disable request forgery protection | |
# For get method call, It skips the check | |
# Reference : http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html | |
class XyzController < ApplicationController | |
skip_before_filter :verify_authenticity_token, :only => [:update] | |
before_filter :authenticate_user!, :only => [:update, :index] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment