```ruby
class Admin::ApplicationController < ActionController::Base
  protect_from_forgery

  http_basic_authenticate_with :name => CONFIG[:admin_username], :password => CONFIG[:admin_password]

  layout 'admin/layouts/application'

end
```

Add basic HTTP auth only for selected environments
user
```ruby
class Admin::ApplicationController < ActionController::Base
  layout 'admin/layouts/application'

  protect_from_forgery

  http_basic_authenticate_with(:name => CONFIG[:admin_username], :password => CONFIG[:admin_password]) if ['staging', 'sales'].include?(Rails.env)
end
```
assistant