{"id":1651,"date":"2009-07-05T07:23:32","date_gmt":"2009-07-05T15:23:32","guid":{"rendered":"https:\/\/www.ultrasaurus.com\/?p=1651"},"modified":"2009-07-05T07:23:32","modified_gmt":"2009-07-05T15:23:32","slug":"rails-admin-interface-roundup","status":"publish","type":"post","link":"https:\/\/www.ultrasaurus.com\/2009\/07\/rails-admin-interface-roundup\/","title":{"rendered":"rails admin interface roundup"},"content":{"rendered":"

After my recent ActiveScaffold post<\/a>, I heard about several newer alternatives from Jaime Flournoy<\/a>, Mike Gunderloy<\/a>, and some more web surfing<\/a>. I evaluated four plugins for admin UI, using the following methodology: <\/p>\n


\nrails xxx_simple
\ncd xxx_simple\/
\n.\/script\/generate scaffold Task title:string notes:text complete:boolean
\nrake db:migrate
\n<\/code> <\/p>\n

plus whatever annotations to the code the plugin needed. Then I ran a little script to generate 500 records:<\/p>\n

500.times do |counter|
\n  `curl -X POST -d \"Another thing #{counter}More text with #{counter} thing\" -H \"Content-Type: application\/xml\" http:\/\/localhost:3000\/tasks.xml`
\nend
\n<\/code>
\nThey all support related models, but I only have screen shots from my simple test. I’ve listed them below with the ones I liked best at the top. <\/p>\n

typus<\/h2>\n

Typus<\/a> is the one I’m moving forward with. It has a clean interface and has nice configuration options. You can configure which columns are displayed and which are searched (with a nice UI touch of displaying the search criteria under the search box). It is actively maintained with quite a few contributors and a responsive google group<\/a>. I really like how relationships are displayed (for which I don’t have a picture, sorry). The only drawback (for me) is that it has its own auth and I don’t really want to introduce a separate set of admin users for the project I am working on, and I’ll be looking into making a change to support my own auth.\u00a0 By default, it adds it’s own typus_users table, but this could be a plus for some.<\/p>\n


\nscript\/plugin install git:\/\/github.com\/fesplugas\/typus.git
\nscript\/generate typus
\nrake db:migrate
\n.\/script\/server
\n<\/p>\n

Now visit http:\/\/localhost:3000\/admin and you will be prompted for your email address, from which it will automatically create the first admin user (pretty slick). The default UI looks like this:<\/p>\n


\n I ran into just one glitch where Rails reported \"A copy of ApplicationController has been removed from the module tree but is still active!\" but it was
easily fixed<\/a>. The error didn't happen in my simple project, but did in my real app. Francesc Esplugas has looked into it and so far can't reproduce it<\/a>.<\/p>\n

admin_data<\/h2>\n

I really liked admin_data<\/a>. The simplicity of the install was breath-taking:
\n
\nruby script\/plugin install git:\/\/github.com\/neerajdotname\/admin_data.git
\nsudo gem install will_paginate
\n.\/script\/server
\n<\/code><\/p>\n

that's it. Now visit http:\/\/localhost:3000\/admin_data and you'll see the following interface:<\/p>\n


\n<\/p>\n

I didn't try it, but I really like the admin_data approach to integrating with the application's authentication: Add the following lines of code in an initializer at ~\/config\/initializers\/admin_data.rb<\/p>\n


\n# authorization check to see if the data should be shown to the user
\nADMIN_DATA_VIEW_AUTHORIZATION = Proc.new { |controller|
\n   controller.send(\"admin_logged_in?\") }
\n# authorization check to see if the user should be allowed to update the data
\nADMIN_DATA_UPDATE_AUTHORIZATION = Proc.new { |controller| return false }
\n<\/code><\/p>\n

streamlined<\/h2>\n

Streamlined<\/a> is nice, but not as pretty as ActiveScaffold. Not compatible with Rails 2.3. This and active_scaffold seem to be a little older than typus and admin_data and require you to modify your code similarly. I thought it nice that it provided its own admin layout. In my simple test I applied the series of steps and nested route as with active_scaffold<\/a>.
\n
\n class MyNiftyController < ApplicationController
\n  layout 'streamlined'
\n  acts_as_streamlined<\/p>\n

...[anything else you want to do]
\n end
\n<\/code>
\n
\n<\/p>\n

active_scaffold<\/h2>\n

See my previous post<\/a> for details. This seems to be the grand-daddy of this genre of plugins and has a very active google group<\/a>. I liked this plugin when I first tried it, but it hung when I applied it to my real app. Also, @jamieflournoy notes<\/a> that he didn't like the UI for editing related models as much as he did Streamlined.<\/p>\n","protected":false},"excerpt":{"rendered":"

After my recent ActiveScaffold post, I heard about several newer alternatives from Jaime Flournoy, Mike Gunderloy, and some more web surfing. I evaluated four plugins for admin UI, using the following methodology: rails xxx_simple cd xxx_simple\/ .\/script\/generate scaffold Task title:string notes:text complete:boolean rake db:migrate plus whatever annotations to the code the plugin needed. Then I… Continue reading →<\/span><\/a><\/p>\n","protected":false},"author":84,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ultrasaurus.com\/wp-json\/wp\/v2\/posts\/1651"}],"collection":[{"href":"https:\/\/www.ultrasaurus.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ultrasaurus.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ultrasaurus.com\/wp-json\/wp\/v2\/users\/84"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ultrasaurus.com\/wp-json\/wp\/v2\/comments?post=1651"}],"version-history":[{"count":0,"href":"https:\/\/www.ultrasaurus.com\/wp-json\/wp\/v2\/posts\/1651\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ultrasaurus.com\/wp-json\/wp\/v2\/media?parent=1651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ultrasaurus.com\/wp-json\/wp\/v2\/categories?post=1651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ultrasaurus.com\/wp-json\/wp\/v2\/tags?post=1651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}