Module: SocialSharer::ViewHelpers
- Defined in:
- lib/social_sharer/view_helpers.rb
Instance Method Summary collapse
-
#social_share_tags(options) ⇒ Object
Given an options object, create a number of social URLs.
Instance Method Details
#social_share_tags(options) ⇒ Object
Given an options object, create a number of social URLs
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/social_sharer/view_helpers.rb', line 4 def () () has_individual_settings = [:individual_settings] twitter_url = has_individual_settings ? [:twitter][:url] : [:url] twitter_url += '?src=tw' = has_individual_settings ? [:twitter][:message] : [:twitter_message] twitter_handle = has_individual_settings ? [:twitter][:handle] : [:twitter_handle] facebook_url = has_individual_settings ? [:facebook][:url] : [:url] facebook_url += '?src=fb' link_to('Share on Twitter', 'http://twitter.com/', rel: 'nofollow', onclick: "popUp=window.open("\ "'http://twitter.com/intent/tweet?text=#{twitter_message} via #{twitter_handle} - #{twitter_url}',"\ "'popupwindow',"\ "'scrollbars=yes,width=800,height=400');"\ "popUp.focus();"\ "return false") + link_to('Share on Facebook', 'http://www.facebook.com/', rel: 'nofollow', onclick: "popUp=window.open("\ "'http://www.facebook.com/sharer.php?u=#{facebook_url}',"\ "'popupwindow',"\ "'scrollbars=yes,width=800,height=400');"\ "popUp.focus();"\ "return false") end |