Skip to content

Instantly share code, notes, and snippets.

@jancel
Created February 18, 2012 18:04
Show Gist options
  • Save jancel/1860426 to your computer and use it in GitHub Desktop.
Save jancel/1860426 to your computer and use it in GitHub Desktop.
def build_table
build_table_head
build_table_body unless @collection.blank?
end
versus
def build_table
build_table_head
build_table_body
end
@jancel
Copy link
Author

jancel commented Feb 18, 2012

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