Easier admin panel for Rails
I've been working on an admin panel for a certain Rails app. One of the most common tasks to writing an admin panel is to generate a table where each column is a different attribute for your model. This is easy to do, but very tedious.
To simplify the task, I looked at metaprogramming. Metaprogramming with Ruby/Rails is very slick. I could generate a table for an arbitrary ActiveRecord starting with this code:
After a few basic iterations, I found that dynamically calling methods is 1) not reliable and 2) inhibits customization. So I found middle ground.
I wrote a basic Sinatra app that generates ERB templates given an ActiveRecord model. So far it will generate a table and a form for any model.
The app makes as little assumptions as possible, it simply takes care of the more tedious aspects of writing an admin panel.
Alan
03 May 2010