Module: SharingTags::ActionView::ButtonHelper
- Defined in:
- lib/sharing_tags/action_view/button_helper.rb
Instance Method Summary collapse
- #link_to_facebook_share(name_or_options = nil, &block) ⇒ Object
- #link_to_google_share(name_or_options = nil, &block) ⇒ Object
- #link_to_line_share(name_or_options = nil, &block) ⇒ Object
- #link_to_linkedin_share(name_or_options = nil, &block) ⇒ Object
- #link_to_odnoklassniki_share(name_or_options = nil, &block) ⇒ Object
- #link_to_twitter_share(name_or_options = nil, &block) ⇒ Object
- #link_to_vkontakte_share(name_or_options = nil, &block) ⇒ Object
- #sharing_tags_buttons(*networks, **options) ⇒ Object
Instance Method Details
#link_to_facebook_share(name_or_options = nil, &block) ⇒ Object
19 20 21 |
# File 'lib/sharing_tags/action_view/button_helper.rb', line 19 def link_to_facebook_share( = nil, &block) share_to , :facebook, [:app_id, :provider, :title, :description, :caption, :image, :return_url], &block end |
#link_to_google_share(name_or_options = nil, &block) ⇒ Object
31 32 33 |
# File 'lib/sharing_tags/action_view/button_helper.rb', line 31 def link_to_google_share( = nil, &block) share_to , :google, [], &block end |
#link_to_line_share(name_or_options = nil, &block) ⇒ Object
27 28 29 |
# File 'lib/sharing_tags/action_view/button_helper.rb', line 27 def link_to_line_share( = nil, &block) share_to , :line, [], &block end |
#link_to_linkedin_share(name_or_options = nil, &block) ⇒ Object
43 44 45 |
# File 'lib/sharing_tags/action_view/button_helper.rb', line 43 def link_to_linkedin_share( = nil, &block) share_to , :linkedin, [:title, :description], &block end |
#link_to_odnoklassniki_share(name_or_options = nil, &block) ⇒ Object
35 36 37 |
# File 'lib/sharing_tags/action_view/button_helper.rb', line 35 def link_to_odnoklassniki_share( = nil, &block) share_to , :odnoklassniki, [:title, :description], &block end |
#link_to_twitter_share(name_or_options = nil, &block) ⇒ Object
39 40 41 |
# File 'lib/sharing_tags/action_view/button_helper.rb', line 39 def link_to_twitter_share( = nil, &block) share_to , :twitter, [:title, :description], &block end |
#link_to_vkontakte_share(name_or_options = nil, &block) ⇒ Object
23 24 25 |
# File 'lib/sharing_tags/action_view/button_helper.rb', line 23 def link_to_vkontakte_share( = nil, &block) share_to , :vkontakte, [:title, :description, :image], &block end |
#sharing_tags_buttons(*networks, **options) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sharing_tags/action_view/button_helper.rb', line 4 def (*networks, **) networks = SharingTags::Network.lists if networks.empty? # switching context if [:context].present? SharingTags.config.switch_context(*[:context]) do context = SharingTags.config.current_context render template: "sharing_tags/buttons.html.slim", locals: {networks: networks, options: , context: context} end else context = SharingTags.config.current_context render template: "sharing_tags/buttons.html.slim", locals: {networks: networks, options: , context: context} end end |