Skip to content

Instantly share code, notes, and snippets.

@RogerPodacter
Created September 22, 2010 18:41
Show Gist options
  • Select an option

  • Save RogerPodacter/592246 to your computer and use it in GitHub Desktop.

Select an option

Save RogerPodacter/592246 to your computer and use it in GitHub Desktop.
def unordered_list(collection, options = {})
output = %{<ul class="#{options.delete(:class).to_s}">}
collection.each do |item|
output += "<li>" + yield(item) + "</li>"
end
return output += "</ul>"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment