Skip to content


Subversion checkout URL

You can clone with
Download ZIP
The administration framework for Ruby on Rails applications.
Ruby Cucumber CSS CoffeeScript HTML
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Active Admin

Active Admin is a tool to facilitate the generation of administration style interfaces.


Although Active Admin is very young in its development cycle, here are its current goals:

  1. Build a toolset to quickly create template-able administration interfaces

  2. Allow the toolset to be entirely customizable (ie: we use standard rails coding practices which can be overridden at any point)

  3. Design an interface which looks great!

  4. Build administration interfaces for common rails plugins as gems and share with the community (ie: devise admin)


Active Admin is very young. Although the code is well tested and is being used in production, the project is under heavy development. Once we get it to a point that has a relatively stable api, we will begin numbered releases starting with a 0.1 release.

Installation (Rails 3)

Add the following to your Gemfile:

gem 'formtastic',     :git => "git://", :branch => 'rails3'
gem 'will_paginate',  :git => "git://", :branch => 'rails3'
gem 'meta_search',    :git => "git://"
gem 'active_admin',   :git => "git://"

Then, run the installer:

rails generate active_admin:install

This will create an initializer which is used for configuring defaults used by Active Admin as well as a new folder at app/admin to put all your admin configurations. Note: All ruby files in the Active Admin load path get loaded into the rails application.


Let's build up an example using a Post model and the provided admin generator.

rails generate active_admin:resource post

That's all you need to get a full CRUD, beautiful administration interface!

The generator will create a new file app/admin/posts.rb that will look like the following:

ActiveAdmin.register Post

Customize the Index Page

By default, the index page is a table with each of the models content columns and links to show, edit and delete the object. There are many ways to customize what gets displayed:

Simple Columns

If all you need to do is change the columns which get displayed, you can do so by passing them to the columns method:

ActiveAdmin.register Post do

  index do |display|
    display.columns :title, :comments_count, :created_at


Or you can pass them in individually:

ActiveAdmin.register Post do

  index do |display|

    # This will title the column 'Title' and call the #title method on each object
    display.column :title

    # This will title the column 'How many comments?' and call the #comments_count method on each object
    display.column 'How many comments?', :comments_count

    # You can add methods to the table builder which builds common things (ie: selectable checkboxes)



Advanced Columns

Sometimes calling methods just isn't enough and you need to write some view specific code. For example, say we wanted a colum called Title which holds a link to the posts admin screen.

You can pass a block to a column which will then be rendered within the context of the view for each of the objects in the collection.

ActiveAdmin.register Post do

  index do |display|
    display.column("Title"){|post| link_to post.title, admin_post_path(post) }


The block gets called once for each resource in the collection. The resource gets passed into the block as an argument.


The index views in Active Admin include sorting by default.

ActiveAdmin.register Post do

  index do |display|

    # A column created by a method call assumes its sortable
    display.column :id

    # If a column is defined using a block, you must pass the key to turn on sorting. The key
    # is the attribute which gets used to sort objects using Active Record.
    display.column("Title", :sortable => :title){|post| link_to post.title, admin_post_path(post) }

    # Turn off sorting by passing false
    display.column :do_not_sort_me, :sortable => false



Customize the Form

Active Admin gives complete control over the output of the form by creating a thin DSL on top of the fabulous DSL created by Formtastic (

ActiveAdmin.register Post do

  form do |f|
    f.inputs "Details" do
      f.input :title
      f.input :published_at, :label => "Publish Post At"
      f.input :category
    f.inputs "Content" do
      f.input :body


Please view the documentation for Formtastic to see all the wonderful things you can do:

Tools Being Used

We believe strongly in not writing code unless we have to, so Active Admin is built using many other open source projects:


Inherited Resources speeds up development by making your controllers inherit all restful actions so you just have to focus on what is important.


Inherited Views is a thin addition to Inherited Resources which adds in html views to the mix


A DSL for semantically building amazing forms.


Pagination for rails apps


Roadmap & Issue Tracking

We are using the awesome Lighthouse ticketing system. The project can be found at:

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.


Copyright © 2010 Greg Bell, VersaPay Corporation. See LICENSE for details.

Something went wrong with that request. Please try again.