Yesterday, we launched Active Admin 0.4.1. I haven’t officially posted since releasing Active Admin 0.3.0, so I thought it was about time to rundown some of the new features and enhancements in Active Admin.

First, thanks to all 52 contributors who have worked on Active Admin since 0.3.2! It’s been amazing to see the community grow around the project.

Here’s a quick rundown of some of the interesting new stuff in Active Admin.

Custom Pages

Since 0.4.0, you can create custom pages. This makes it trivial to add pages to your application while fitting into the existing Active Admin design and interface conventions.

The above page can be made with:

ActiveAdmin.register_page "My Custom Page" do
  content do
    panel "Hello World" do
      "Why so easy?"
    end
  end
end

Pages also have support for sidebar sections, actions items, menu configurations and controller actions. Checkout the full docs at http://activeadmin.info/docs/9-custom-pages.html

Columns Component Updates

The columns component has gotten some love in 0.4.1 which includes a new span option. This makes it easy to create different column layouts anywhere in Active Admin.

To use the column spans, simply pass in the span option to your column:

columns do
  column :span => 3 do
    span "Inside a column with the width of 3"
  end
  column do
    span "Inside a column with the width of 1"
  end
end

:if Support on Most Components

All components (except for filters) now support the :if option. The :if option accepts a proc which will be rendered in the context of the view. This way you can conditionally display any component based on the current user (or other runtime attributes).

For example:

ActiveAdmin.register Post do
  sidebar "Super Admin", :if => proc{ current_admin_user.super_admin? } do
    span "Only visible by super admins"
  end
end

Visual & CSS Update

Matt Vague has been working hard on cleaning up the stylesheets and the visual styles.  One new major piece of design sexiness is the new scopes:

Other Enhancements or Features

  • Custom pagination settings per resource
  • Option to hide scope counts on index screen
  • Navigation now works when using RackBaseURI
  • Set the site title to an image instead of text
  • Register stylesheets with a media type
  • A bunch of I18n updates
  • For a full list of changes and updates, checkout the Changelog

Dependencies

  • Support for Rails 3.2.x
  • Support for Inherited Resources 0.3.0
  • Support for Formtastic 2
  • Removed bundled jQuery (using gem now)
  • Fixed issues when WillPaginate was installed in your application

Bug Squash Day

As I mentioned on the mailing list, we’re having a bug squash day this Saturday to help close as many of the issues on Github as possible. If your available and are interested in helping out with Active Admin, please join us on the #activeadmin  channel on Freenode from 9am PST to 1pm on Saturday (Feb 18). See you all there!