Skip to content

Instantly share code, notes, and snippets.

@Fivell
Created November 1, 2012 19:42
Show Gist options
  • Save Fivell/3995962 to your computer and use it in GitHub Desktop.
Save Fivell/3995962 to your computer and use it in GitHub Desktop.
active admin custom class for td
module ActiveAdmin
module Views
class TableFor < Arbre::HTML::Table
def build_table_cell(col, item)
td(:class => ( col.options[:class] || (col.data.to_s.downcase if col.data.is_a?(Symbol)))) do
rvalue = call_method_or_proc_on(item, col.data, :exec => false)
if col.data.is_a?(Symbol)
rvalue = pretty_format(rvalue)
end
rvalue
end
end
class Column
attr_accessor :options
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment