Module: Integral::SocialHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/integral/social_helper.rb
Overview
Social Helper which contains methods relating to social networking
Instance Method Summary collapse
-
#facebook_share_url(opts = {}) ⇒ String
Facebook social sharing URL snippet built from - sharingbuttons.io/.
-
#facebook_url ⇒ String
Facebook Profile URL set from within Backend Settings area.
-
#github_url ⇒ String
Github URL set from within Backend Settings area.
-
#instagram_url ⇒ String
Instagram Profile URL set from within Backend Settings area.
-
#linkedin_share_url(opts = {}) ⇒ String
Linkedin social sharing URL snippet built from - sharingbuttons.io/.
-
#linkedin_url ⇒ String
Linkedin Profile URL set from within Backend Settings area.
-
#mail_share_url(opts = {}, escape: true) ⇒ String
Mail link sharing.
-
#twitter_share_url(opts = {}) ⇒ String
Twitter social sharing URL snippet built from - sharingbuttons.io/.
-
#twitter_url ⇒ String
Twitter Profile URL set from within Backend Settings area.
-
#youtube_url ⇒ String
Youtube Profile URL set from within Backend Settings area.
Instance Method Details
#facebook_share_url(opts = {}) ⇒ String
Facebook social sharing URL snippet built from - sharingbuttons.io/
52 53 54 55 56 57 58 59 |
# File 'app/helpers/integral/social_helper.rb', line 52 def facebook_share_url(opts = {}) page_url = opts.fetch(:url, request.original_url) page_url = CGI.escape(page_url) share_url = "https://facebook.com/sharer/sharer.php?u=#{page_url}" share_url end |
#facebook_url ⇒ String
Facebook Profile URL set from within Backend Settings area
97 98 99 |
# File 'app/helpers/integral/social_helper.rb', line 97 def facebook_url Settings.facebook_url end |
#github_url ⇒ String
Github URL set from within Backend Settings area
83 84 85 |
# File 'app/helpers/integral/social_helper.rb', line 83 def github_url Settings.github_url end |
#instagram_url ⇒ String
Instagram Profile URL set from within Backend Settings area
118 119 120 |
# File 'app/helpers/integral/social_helper.rb', line 118 def instagram_url Settings.instagram_url end |
#linkedin_share_url(opts = {}) ⇒ String
Linkedin social sharing URL snippet built from - sharingbuttons.io/
69 70 71 72 73 74 75 76 77 78 |
# File 'app/helpers/integral/social_helper.rb', line 69 def linkedin_share_url(opts = {}) page_url = opts.fetch(:url, request.original_url) = opts.fetch(:message, '') page_url = CGI.escape(page_url) share_url = "https://www.linkedin.com/shareArticle?mini=true&url=#{page_url}" share_url += "&title=#{CGI.escape()}" if .present? share_url end |
#linkedin_url ⇒ String
Linkedin Profile URL set from within Backend Settings area
111 112 113 |
# File 'app/helpers/integral/social_helper.rb', line 111 def linkedin_url Settings.linkedin_url end |
#mail_share_url(opts = {}, escape: true) ⇒ String
Mail link sharing
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/helpers/integral/social_helper.rb', line 11 def mail_share_url(opts = {}, escape: true) page_url = opts.fetch(:url, request.original_url) = opts.fetch(:message, '') if escape page_url = CGI.escape(page_url) = CGI.escape() if .present? end share_url = "mailto:?body=#{page_url}" share_url += "&subject=#{}" if .present? share_url end |
#twitter_share_url(opts = {}) ⇒ String
Twitter social sharing URL snippet built from - sharingbuttons.io/
34 35 36 37 38 39 40 41 42 43 |
# File 'app/helpers/integral/social_helper.rb', line 34 def twitter_share_url(opts = {}) page_url = opts.fetch(:url, request.original_url) = opts.fetch(:message, '') page_url = CGI.escape(page_url) share_url = "https://twitter.com/intent/tweet/?url=#{page_url}" share_url += "&text=#{CGI.escape()}" if .present? share_url end |
#twitter_url ⇒ String
Twitter Profile URL set from within Backend Settings area
90 91 92 |
# File 'app/helpers/integral/social_helper.rb', line 90 def twitter_url Settings.twitter_url end |
#youtube_url ⇒ String
Youtube Profile URL set from within Backend Settings area
104 105 106 |
# File 'app/helpers/integral/social_helper.rb', line 104 def youtube_url Settings.youtube_url end |