How to use Active Admin gem in rails?

Reading Time: < 1


Active Admin is a framework for creating administration style interfaces. In this blog, I have shared how can you use active admin gem in rails easily.

First and foremost, active admin is released as a Ruby Gem. This gem needs to be installed within a Ruby on Rails 3 application.


image source

Steps to install and use active admin gem in your ruby on rails application

Step -1

To install, simply add the following to your gemfile:

# Gemfile

  gem ‘activeadmin’

Step -2

If you are using Rails 3.1, you must also include a beta version of MetaSearch and sass-rails:

# Gemfile in Rails >= 3.1

  gem ‘activeadmin’

  gem ‘sass-rails’

  gem “meta_search”, ‘>= 1.1.0.pre’

Step -3

After updating your bundle, run the installer

$> rails generate active_admin:install

This installer creates an initializer used for configuring defaults used by Active Admin as well as a new folder at app/admin to put all your admin configurations.

Step -4

Migrate your database and start the server using these commands:

$> rake db:migrate

$> rails server

Step -5

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

User: [email protected]com

Password: password

If you have any further doubts, drop us an email at [email protected] and we’ll get back to you with the best possible solution. Infigic is a Ruby on Rails Development Company and we are always there to solve your queries.