Created
November 1, 2012 19:42
-
-
Save Fivell/3995962 to your computer and use it in GitHub Desktop.
active admin custom class for td
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 characters
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