10
11
12
13
14
15
16
17
18
|
# File 'lib/pin_it.rb', line 10
def pin_it_button(options = {})
%{<a href="http://pinterest.com/pin/create/button/?url=page_url&media=img_url&description=description" class="pin-it-button" count-layout="horizontal">Pin It</a>}
query_params = options.slice(:url, :media, :description)
layout_params = options[:count_layout]
img = tag :img, :src => "//assets.pinterest.com/images/PinExt.png", :title => "Pin It", :border => "0"
content_tag :a, img, "href" => "http://pinterest.com/pin/create/button/?#{query_params.to_query}",
"class" => "pin-it-button",
"count-layout" => layout_params || "horizontal"
end
|