Last active
December 23, 2015 23:09
-
-
Save chadwtaylor/6708300 to your computer and use it in GitHub Desktop.
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
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
# Need a way to use :except to ignore a specific controller (ie: MessagesController) | |
before_filter :authenticate, :except => ["index"] | |
private | |
def authenticate | |
authenticate_or_request_with_http_basic('Administration') do |username, password| | |
username == 'admin' && password == 'password' | |
end | |
end | |
end |
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
class MessagesController < ApplicationController | |
# this controller should not require HTTP Authentication | |
skip_before_filter :authenticate | |
def messages_inbound | |
# do stuff here | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you might need to change that to this:
def authenticate
authenticate_or_request_with_http_basic('Administration') do |username, password|
username == 'admin' && password == 'password'
end
end