Sha256: d740b615426dd2fedc1ea4a76079935fd3c8b818250c57caa86f21c2643d8bd7
Contents?: true
Size: 868 Bytes
Versions: 1
Compression:
Stored size: 868 Bytes
Contents
# coding: utf-8 module LoyalShareButtons module Helper def loyal_share_buttons_tag(title = "", opts = {}) rel = opts[:rel] html = [] html << "<div class='loyal_share_buttons' data-title='#{title}' data-img='#{opts[:image]}'>" ::LoyalShareButtons.config.allow_sites.each do |_name| _name = _name.downcase name = I18n.t("views.loyal_share_buttons.#{_name}") link_title = I18n.t "views.loyal_share_buttons.share_to", :name => name html << link_to("","javascript:;", :rel => "nofollow #{rel}", "data-site" => _name, :class => "loyal_share_buttons-#{_name}", :onclick => "return LoyalShareButtons.share(this);", :title => h(link_title)) end html << "</div>" raw html.join("\n") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
loyal_share_buttons-1.0.0 | lib/loyal_share_buttons/helper.rb |