Skip to content

Instantly share code, notes, and snippets.

@suhanlee
Created July 3, 2016 06:29
Show Gist options
  • Save suhanlee/2d0589860765924f19549039556632eb to your computer and use it in GitHub Desktop.
Save suhanlee/2d0589860765924f19549039556632eb to your computer and use it in GitHub Desktop.
Rails
# "Can't verify CSRF token authenticity" for json format
class ApplicationController < ActionController::Base
protect_from_forgery with: :null_session, only: Proc.new { |c| c.request.format.json? }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment