Sha256: b3425821ed9d6e3cb9a542876dc457dfdc36e38085648db334fcc88c8228a1bd

Contents?: true

Size: 821 Bytes

Versions: 3

Compression:

Stored size: 821 Bytes

Contents

# coding: utf-8
module SocialShareButton
  module Helper
    def social_share_button_tag(title = "", opts = {})
      rel = opts[:rel]
      html = []
      html << "<div class='social-share-button' data-title='#{title}' data-img='#{opts[:image]}' data-url='#{opts[:url]}'>"
      
      SocialShareButton.config.allow_sites.each do |name|
        link_title = t "social_share_button.share_to", :name => t("social_share_button.#{name.downcase}")
        html << link_to("","#", :rel => "nofollow #{rel}", 
                        "data-site" => name, 
                        :class => "social-share-button-#{name}", 
                        :onclick => "return SocialShareButton.share(this);",
                        :title => h(link_title))
      end
      html << "</div>"
      raw html.join("\n")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
social-share-button-0.1.1 lib/social_share_button/helper.rb
social-share-button-0.1.0 lib/social_share_button/helper.rb
social-share-button-0.0.9 lib/social_share_button/helper.rb