Skip to content

Instantly share code, notes, and snippets.

@stuartc
Created October 18, 2014 12:33
Show Gist options
  • Save stuartc/081931c855978cb554d3 to your computer and use it in GitHub Desktop.
Save stuartc/081931c855978cb554d3 to your computer and use it in GitHub Desktop.
Disable Sessions and CSRF Protection on Rails
class MyController < ApplicationController
protect_from_forgery with: :null_session, if: Proc.new { |c| c.request.format == 'application/json' }
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment