Created
July 8, 2013 22:14
-
-
Save djbender/5952946 to your computer and use it in GitHub Desktop.
http_basic_authenticate_with
This file contains hidden or 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
class PostsController < ApplicationController | |
http_basic_authenticate_with name: "dhh", password: "secret", except: :index | |
def index | |
render text: "Everyone can see me!" | |
end | |
def edit | |
render text: "I'm only accessible if you know the password" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment