10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/social_buttons/view_helpers/pinit.rb', line 10
def pinit_button(options = {})
clazz = SocialButtons::Pinit
default_options = {url: request.url, media: request.url}
params = clazz.default_options.merge(clazz.default_options).merge(options)
params.merge!(:class => CLASS)
query_string = clazz.options_to_query_string(self, params)
option_params = params.except(:url, :media, :description)
pinit_link = PINIT_CREATE_BUTTON + query_string
html = "".html_safe
html << link_to(pinit_link, option_params) do
image_tag PINIT_BUTTON_IMAGE, border: ("0" || options[:border]), title: (TITLE || options[:title])
end
html << clazz::Scripter.new(self).script
html
end
|