Created
June 19, 2009 12:44
-
-
Save mattsears/132597 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
# 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