Created
April 10, 2011 19:03
-
-
Save carpeliam/912617 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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