I donβt think this might work, because if the expression is evaluated at the time the controller class was created, why params[:api_key].present?
is false at this moment ... u can try
skip_before_filter :verify_authenticity_token, :if =>lambda{ params[:api_key].present?}
source share