Skip to content

Instantly share code, notes, and snippets.

@mwhuss
Created February 9, 2011 13:51
Show Gist options
  • Select an option

  • Save mwhuss/818503 to your computer and use it in GitHub Desktop.

Select an option

Save mwhuss/818503 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
def authenticate
authenticate_or_request_with_http_basic do |user, password|
user == USER_ID && password == PASSWORD
end
end
end
class ApiController < ApplicationController
before_filter :authenticate
def index
...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment