Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.29 KB | None | 0 0
  1. class ApplicationController < ActionController::Base
  2.   protect_from_forgery
  3.   # look for a better way to allow JSON requests w/o CSRF token from devices
  4.   skip_before_filter :verify_authenticity_token, if: :json_request?
  5.  
  6.   protected
  7.  
  8.   def json_request?
  9.     request.format.json?
  10.   end
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement