Created
May 23, 2011 13:55
Revisions
-
torrick created this gist
May 23, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ ActiveAdmin.register Company do filter :name filter :customer_type, :as => :check_boxes index do column :name, :sortable => :name do |company| auto_link(company) end column :active do |company| company.active? ? icon(:check) : icon(:x) end end show :title => :name do panel "Company Details" do attributes_table_for company do row :name row :notes row(:active) { company.active? ? icon(:check) : icon(:x) } end end if company.app_servers.count > 0 panel "App Servers" do table_for(company.app_servers) do |t| t.column(:name) { |server| link_to server.name, admin_company_app_server_path(company, server) } t.column("Internal IP", :internal_ip) t.column("External IP", :external_ip) t.column() { |server| link_to "Edit", edit_admin_company_app_server_path(company, server) } end end else panel "App Servers" do link_to 'New App Server', new_admin_company_app_server_path(company) end end end end