Created
April 4, 2014 22:44
-
-
Save lelandsmith/9984514 to your computer and use it in GitHub Desktop.
rails:password_protected_page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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