Marko Anastasov wrote this on September 21, 2011

admin_view: minimal admin interface generator for your Rails 3 models

We’ve released the first version of admin_view, a gem that adds a minimal admin interface generator for your models. It works with Rails 3 and gives you a controller, views and specs, with an assumption that you’re authenticating users with Devise.

For example, if you type:

bundle exec rails g admin_view User --search_by name

you’ll get something like this:

The search form is powered by meta_search, and you can easily tweak it to cover more columns. You also get sortable columns, and screens to CRUD individual records.

The markup is bare bones, and this is on purpose - our only guideline was that it should look good with the Railscasts stylesheet, which we use for admin interface in all our applications.

Subscribe to gem updates on RubyGems or watch the repo to stay up-to-date on future improvements.


admin_view generates code (not much), because in our practice one size can’t fit all. We always need to be able to change something about the default, scaffold-like stuff: tweak which columns go in the listing table, how admin creates a new record (if at all), what editing means (if at all), how data in the show action is connected to other records etc.

But we need to have a starting point that works, and is covered by specs. So if we need something special, we can quickly write a Cucumber scenario, and make it all green. We’re dealing with basic Rails stuff there, so change is rapid, and there’s no additional API to memorize. For these reasons, something like active_admin is not what we need.


Packaging the generator as a Rails 3 gem was challenging. We had to examine the source code of various plugins and Rails itself in order to figure out the naming conventions, and how the tests can be set up (that’s one reason we’re releasing this now and not in January when the first commit went in). I’m still hoping to enhance the tests to include one temporary model as a basis for testing views.

The source is small and it can be a reference to anyone who wants to implement a Rails 3 generator plugin as a gem. Here are some links that we found useful:

comments powered by Disqus

About Marko Anastasov

Marko co-founded Rendered Text. He’s a programmer with a passion of creating something for other people, coupled with interests in how things work in the society and nature. He is having a great time working across many areas in the company, including product design, helping the engineering teams, empowering users and marketing. He likes to counterbalance it all with running, cycling or a day in the woods.

Suggested Reads

Inheritance in the Database

In martial arts, fundamentals are everything. The basic kicks, rolls and jumps are far more important that any fancy technique you will learn during the years of practice. When you improve your basic rolls even a little bit, all the body throws that...

Closures are not magic

Several years ago, while I was still a high school student, a friend of mine introduced me the concept of closures. I didn’t understand even a bit of what he wanted to show me, but he looked really hyped when he talked about them. To me, it all looked like some kind of deep magic. Even Google didn’t help. All I could find were scientific papers, that were incomprehensible for a high school student.


Rendered Text is a software company. For questions regarding Semaphore, please visit Otherwise, feel free to get in touch any time by sending us an email.

Rendered Text
Svetozara Miletica 10
21000 Novi Sad