AutoAdmin: Auto-generated admin interface in a Rails plugin
By Peter Cooper / August 17, 2006
AutoAdmin is a new plugin for Rails that automatically generates an administration interface for your models. It's heavily inspired by Django, where meta-data relating to the administration interface is placed directly into the models. This goes directly against David Heinemeier Hansson's preferences, but might be perfect for your own systems.
Example model code:
class Customer < ActiveRecord::Base belongs_to :store has_many :payments, :order => 'payment_date DESC' def name; first_name + '' + last_name; end sort_by :last_name search_by :first_name, :last_name filter_by :active, :store default_filter :active => true list_columns :store, :first_name, :last_name admin_fieldset do |b| b.text_field :first_name b.text_field :last_name b.select :store end admin_child_table 'Payments', :payments do |b| b.static_text :payment_date b.static_text :amount end end
Comments
-
Mike Blair says:
August 17, 2006 at 10:29 pmCool, the admin interface was by far the best part of Django.
-
Jeff says:
August 18, 2006 at 12:04 amThanks, I was looking for a write up of this earlier today, but couldn't find one. Finding this in my feed agg hit the spot.
-
Christoffer Sawicki says:
August 18, 2006 at 8:42 pmAnother project with similar scope: http://streamlined.relevancellc.com/
Other Posts to Enjoy
-
Ruby’s Unary Operators and How to Redefine Their Functionality
Ruby’s Unary Operators and How to Redefine Their Functionality
-
The Split is Not Enough: Unicode Whitespace Shenigans for Rubyists
The Split is Not Enough: Unicode Whitespace Shenigans for Rubyists
-
The Mega Ruby News and Release Roundup for February 2012
The Mega Ruby News and Release Roundup for February 2012
-
A Lagom Review of O’Reilly’s ‘Sinatra Up and Running’
A Lagom Review of O’Reilly’s ‘Sinatra Up and Running’