Install Active Admin on a Rails App

Techie     February 2022

Definition

Active Admin is a Ruby on Rails gem for generating administration interfaces.


Make sure Devise is installed and properly configured.

1. Add the gem

Open up your Gemfile and add these lines. NB: This has been tested with Rails 7 ☑️

#/Gemfile

# Use activeadmin
gem 'activeadmin', github: 'tagliala/activeadmin', branch: 'feature/railties-7' # FIXME: revert to stable
gem 'arbre', github: 'activeadmin/arbre' # FIXME: remove
gem 'inherited_resources', github: 'activeadmin/inherited_resources' # FIXME: remove

# Use sass-rails
gem 'sass-rails'

and run:

$ bundle install
	


2. Set up activeadmin in your app

	
$ rails generate active_admin:install

$ rails db:migrate


3. Visit http://localhost:3000/admin and log in using:

User: admin@example.com
Password: password


4. Register a model

To register your first model, run:

$ rails generate active_admin:resource MyModel


Thanks for reading, see you in the next one!