Sha256: 2cf027d933be4e026a6edb260a4148103f826b73958c02ae3158acca23241db4
Contents?: true
Size: 604 Bytes
Versions: 1
Compression:
Stored size: 604 Bytes
Contents
module Spree module PinterestHelper def pin_it_button(product) return if product.images.empty? url = escape spree.product_url(product) media = escape product.images.first.attachment.url description = escape product.name link_to("Pin It", "http://pinterest.com/pin/create/button/?url=#{url}&media=#{media}&description=#{description}", :class => "pin-it-button", "count-layout" => "horizontal").html_safe end private def escape(string) URI.escape string, /[^#{URI::PATTERN::UNRESERVED}]/ end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
spree_pinterest-0.2.0 | app/helpers/spree/pinterest_helper.rb |