Created
February 18, 2012 18:04
-
-
Save jancel/1860426 to your computer and use it in GitHub Desktop.
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
def build_table | |
build_table_head | |
build_table_body unless @collection.blank? | |
end | |
versus | |
def build_table | |
build_table_head | |
build_table_body | |
end |
If we need to, we can also do this in build_table_body directly, the problem is that when a collection is blank, it is evaluating and still putting it in the tbody ([]) which ends up looking messy.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
here is the actual git diff
diff --git a/lib/active_admin/views/components/table_for.rb b
index b3e846e..bb05ff1 100644
--- a/lib/active_admin/views/components/table_for.rb
+++ b/lib/active_admin/views/components/table_for.rb
@@ -12,7 +12,7 @@ module ActiveAdmin
@resource_class = options.delete(:i18n)
@collection = collection
@columns = []
@@ -50,7 +50,7 @@ module ActiveAdmin
end
def build_table_head