Skip to content

Instantly share code, notes, and snippets.

@igkuz
Created October 29, 2013 10:16
Show Gist options
  • Save igkuz/7212031 to your computer and use it in GitHub Desktop.
Save igkuz/7212031 to your computer and use it in GitHub Desktop.
module ApiHelper
def require_auth
head :forbidden unless current_client
end
def current_client
@client ||= Client.find_by_api_token(params[:api_token])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment