From d2fac8e685b3de6e81908bb708846d57b9910b23 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 25 Feb 2013 10:47:50 -0500 Subject: [PATCH] a little cleaner --- .../active_admin.rb | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/lib/semantic_rails_view_helpers/active_admin.rb b/lib/semantic_rails_view_helpers/active_admin.rb index 5575f46..4362179 100644 --- a/lib/semantic_rails_view_helpers/active_admin.rb +++ b/lib/semantic_rails_view_helpers/active_admin.rb @@ -6,25 +6,9 @@ class ActiveAdmin::Views::AttributesTable th do header_content_for(attr) end - td do - content_for(attr, block) + td 'data-field' => attr do + content_for(block || attr) end end end - - protected - def content_for(attr, block) - value = begin - if block - block.call(@record) - else - content_for_attribute(attr) - end - end - - value = pretty_format(value) - value == "" || value.nil? ? empty_value : value - - %{#{value}}.html_safe - end end