do NOT add devise
gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"
bundle install
rails g rails_admin:install
Remove everything you do not need: migrations + added devise in Gemfile
In config/initializers/rails_admin.rb
:.
RailsAdmin.config do |config|
config.authorize_with do
authenticate_or_request_with_http_basic('Site Message') do |username, password|
username == 'foo' && password == 'bar'
end
end
config.main_app_name { ['My App', 'Admin'] }
end
Thanks to phoet for providing the hints in the gist I have forked from.
This doesn't seem to work. When the HTTP Basic authentication box appears, pressing cancel without providing any credentials grants access to rails_admin. I fixed it by doing the following:
In config/initializers/rails_admin.rb: