I used code from
but added it to Application controller to apply to the whole
class ApplicationController < ActionController::Base
puts 'authenticating.. '
authenticate_or_request_with_http_basic do |username, password|
username == "foo" && password == "bar"
that does not seem to work... any ideas why?