Skip to content

Instantly share code, notes, and snippets.

@carpeliam
Created April 10, 2011 19:03
Show Gist options
  • Save carpeliam/912617 to your computer and use it in GitHub Desktop.
Save carpeliam/912617 to your computer and use it in GitHub Desktop.
module DealsHelper
def render_deals
Deal.all.collect do |deal|
content_tag :div, :class => 'deal' do
image_tag(deal.photo_url)
content_tag :h3, deal.title, :class => 'title'
content_tag :p, deal.full_price, :class => 'full_price'
content_tag :p, deal.selling_price, :class => 'selling_price'
content_tag :p, deal.discount, :class => 'discount'
content_tag :p, deal.store.name, :class => 'store_name'
link_to "Buy", buy_deal_path(deal)
end
end.join(tag("br")).html_safe
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment