module ShareButton::Helper

Public Instance Methods

social_share_button_tag(title, opts = {}) click to toggle source
# File lib/share_button/helper.rb, line 4
def social_share_button_tag(title, opts = {})
  @opts = opts
  @opts[:allow_sites] ||= SocialShareFeature.allow_sites_for_share_button
  @html = []
  @html << "<div class='share-button' data-title='#{h title}' data-img='#{opts[:image]}'"
  @html << "data-url='#{opts[:url]}' data-desc='#{opts[:desc]}' data-via='#{opts[:via]}'>"
  generate_link
  @html << "</div>"
  raw @html.join("\n")
end