Skip to content

Instantly share code, notes, and snippets.

@lelandsmith
Created April 4, 2014 22:44
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 lelandsmith/9984514 to your computer and use it in GitHub Desktop.
Save lelandsmith/9984514 to your computer and use it in GitHub Desktop.
rails:password_protected_page
before_filter :authenticate, :except => [ :index, :show ]
def authenticate
authenticate_or_request_with_http_basic do |name, password|
name == "admin" && password == "secret"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment