mattsears (owner)

Revisions

gist: 132597 Download_button fork
public
Public Clone URL: git://gist.github.com/132597.git
application_helper.rb
1
2
3
4
5
6
  # 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