Created
February 18, 2012 18:04
-
-
Save jancel/1860426 to your computer and use it in GitHub Desktop.
This file contains 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 |
yes. sorry, this is in... lib/active_admin/views/components/table_for
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 = []
-
build_table
-
endbuild_table super(options)
@@ -50,7 +50,7 @@ module ActiveAdmin
def build_table
build_table_head
-
build_table_body
-
build_table_body unless @collection.blank?
end
def build_table_head
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
The first version is your fix?