Skip to content

Instantly share code, notes, and snippets.

@sandipransing
Created March 9, 2011 10:05
Show Gist options
  • Select an option

  • Save sandipransing/861985 to your computer and use it in GitHub Desktop.

Select an option

Save sandipransing/861985 to your computer and use it in GitHub Desktop.
try this
def group_li_formatting(collection, column_one, column_two, column_three, options = {})
html_attributes_options(options)
li_default_options = {'data-role'=>"list-divider"}
list = collection.collect do |created, post|
tags = [content_tag("li", created, li_default_options)]
tags += post.collect do |p|
content_tag("li", "<h3>p.column_one</h3><p><strong>p.column_two</strong></p><p>p.column_three</p>".html_safe)
end
tags
end
content_tag(:ul, list.join.html_safe, default_options.update('data-inset' => 'false'))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment