Skip to content

Instantly share code, notes, and snippets.

@brynary
Created March 30, 2013 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brynary/5277477 to your computer and use it in GitHub Desktop.
Save brynary/5277477 to your computer and use it in GitHub Desktop.
class FooController < ApplicationController
before_filter :api_authenticate
# ...
def api_authenticate
authenticate_or_request_with_http_basic do |username, password|
username == "foo" && password == "bar"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment