How to choose the right admin gem for your Rails application

ActiveAdmin, Administrate, or Avo? And do we need an admin panel at all?

How to choose the right admin gem for your Rails application

What is an admin panel?

Admin panels, also known as back-office systems, are crucial components of many websites and applications for several reasons. Here are some reasons why they are needed:

  1. Content management: Admin panels allow website owners and administrators to easily manage and update content without needing technical expertise. This includes adding new pages, uploading images and videos, and making changes to existing content.

  2. User management: Admin panels enable administrators to manage user accounts, permissions, and roles. This is essential for controlling access to different parts of the website or application based on user roles and responsibilities.

  3. Data danagement: Admin panels provide a centralized interface for managing data, such as customer information, orders, and other important data sets. This makes it easier to track and analyze data for better decision-making.

  4. Security: Admin panels often include security features that help protect the website or application from unauthorized access and malicious attacks. Admins can monitor user activity, set up secure login credentials, and implement security protocols to safeguard sensitive information.

Do we really need one?

Practically every Rails app I was working on over the years had some kind of an admin panel. Some were more sophisticated than others, but most applications will have one. Not necessarily built on top of a popular gem, but one nevertheless. Despite this, there are people that skip building an admin panel and swear by the allmighty rails console .

Personally, I don't think that the Rails console is sufficient. It's possibly dangerous to run it for something that could be a premade and well tested task. We might also need to expose it to support staff that won't have access to a production database. On the other hand I don't believe we should be exposing every single model table and every record. Simply whatever we need to administer the app at hand.

37signals

But what do I know? I just know that I was suprised I haven't found a proper admin in the codebase of Fizzy, the newest product from 37signals that came with open code for anyone to see. Lucky for me, I got a great answer which I can now share with you.

Seems like 37signals does indeed have some systems to manage the backoffice for Basecamp and HEY and they even come with fun names! We even got a glimpse of how they look like in a later post. Here's the Trek for Basecamp:

And here's the Post Office for HEY:

Choosing the gem

Now that we confirmed that an admin is a useful thing to have, we need to decide how we want to implement it. First of all, you can implement admin as any other screen in the application. Perhaps with a specific theme, perhaps with the same. That's how Business Class template was always done. One less dependency and CRUD generator that also creates admin pages with tables, filters and what not. There is undisputed advantage to this, from ultimate flexibility to reduced dependency chain.

However, building custom screens can still be tedious and a chore that people like to avoid. Many gems tried to streamline this to something more joyful. You have probably heard about Active Admin, which is likely the most used admin gem for Rails of all times. But choosing a gem is not just a popularity contest. Some gems implement their own DSL and some try to avoid it and take advantage of standard Rails views.

There are bunch of cool admin gems but I believe they are four that stands out and that we could consider for a default for Business Class 3.0.

Active Admin

Active Admin is the most used gem to build a back office,but lately a little bit outshined by some competitors. Don't worry though, because Active Admin v4 is already in beta and may turned out to be better than ever.

Avo

Avo is the most active and visible admin gem today. Is there even a conference where Adrian and the Avo team is missing? Avo stole the spotlight from Active Admin and might as well be the most featured out of all of them.

Administrate

Administrate by thoughtbot is a library that generates admin dashboards and it's the counterpoint to learning and hacking custom admin panels DSL.

Madmin

Madmin is one of the latest additions to the ecosystem of admin panels from the authors of popular Pay gem. Madmin focuses on providing less DSL and good interoperability with Rails standard features like import maps.

Fin

So what to do? Should Business Class integrate more with one of the admin panels to speed that initial time to market? Or are we good with a few views to manage user accounts and subscriptions?