Skip to content

Instantly share code, notes, and snippets.

@mattsears
Created June 19, 2009 12:44
Show Gist options
  • Save mattsears/132597 to your computer and use it in GitHub Desktop.
Save mattsears/132597 to your computer and use it in GitHub Desktop.
# A handy way to display lists from collection
def list(stuff, options = {}, &block)
return content_tag(:p, "None") if stuff.nil? || stuff.empty?
content_tag(:ul, stuff.map { |thingie| content_tag(:li, yield(thingie)) }, options)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment