Installation

Active Admin is a Ruby Gem.

gem 'activeadmin'

More accurately, it's a Rails Engine that can be injected into your existing Ruby on Rails application.

Setting up Active Admin

After installing the gem, you need to run the generator (one of the following):

rails g active_admin:install              # creates the AdminUser class
rails g active_admin:install User         # uses an existing class
rails g active_admin:install --skip-users # skips user authentication entirely

The generator adds these core files, among others:

app/admin/dashboard.rb
app/assets/javascripts/active_admin.js.coffee
app/assets/stylesheets/active_admin.css.scss
config/initializers/active_admin.rb

Now, migrate your database and start the server:

rake db:migrate
rails server

Visit http://localhost:3000/admin and log in as the default user:

Voila! You're on your brand new Active Admin dashboard.

To register an existing model with Active Admin:

rails generate active_admin:resource MyModel

This creates a file at app/admin/my_model.rb to set up the UI; refresh your browser to see it.

Upgrading

When upgrading to a new version, it's a good idea to check the CHANGELOG.

To update the JS & CSS assets:

rails generate active_admin:assets

You should also sync these files with their counterparts in the AA source code:

Gem compatibility

will_paginate

If you use will_paginate in your app, you need to configure an initializer for Kaminari to avoid conflicts.

# config/initializers/kaminari.rb
Kaminari.configure do |config|
  config.page_method_name = :per_page_kaminari
end