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.
-
#google_plus_share_url(opts = {}) ⇒ String
Google Plus social sharing URL snippet built from - sharingbuttons.io/.
-
#google_plus_url ⇒ String
Google Plus Profile 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.
-
#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/
30 31 32 33 34 35 36 37 |
# File 'app/helpers/integral/social_helper.rb', line 30 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
91 92 93 |
# File 'app/helpers/integral/social_helper.rb', line 91 def facebook_url Settings.facebook_url end |
#github_url ⇒ String
Github URL set from within Backend Settings area
77 78 79 |
# File 'app/helpers/integral/social_helper.rb', line 77 def github_url Settings.github_url end |
#google_plus_share_url(opts = {}) ⇒ String
Google Plus social sharing URL snippet built from - sharingbuttons.io/
46 47 48 49 50 51 52 53 |
# File 'app/helpers/integral/social_helper.rb', line 46 def google_plus_share_url(opts = {}) page_url = opts.fetch(:url, request.original_url) page_url = CGI.escape(page_url) share_url = "https://plus.google.com/share?url=#{page_url}" share_url end |
#google_plus_url ⇒ String
Google Plus Profile URL set from within Backend Settings area
105 106 107 |
# File 'app/helpers/integral/social_helper.rb', line 105 def google_plus_url Settings.google_plus_url end |
#instagram_url ⇒ String
Instagram Profile URL set from within Backend Settings area
119 120 121 |
# File 'app/helpers/integral/social_helper.rb', line 119 def instagram_url Settings.instagram_url end |
#linkedin_share_url(opts = {}) ⇒ String
Linkedin social sharing URL snippet built from - sharingbuttons.io/
63 64 65 66 67 68 69 70 71 72 |
# File 'app/helpers/integral/social_helper.rb', line 63 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(message)}" if .present? share_url end |
#linkedin_url ⇒ String
Linkedin Profile URL set from within Backend Settings area
112 113 114 |
# File 'app/helpers/integral/social_helper.rb', line 112 def linkedin_url Settings.linkedin_url end |
#twitter_share_url(opts = {}) ⇒ String
Twitter social sharing URL snippet built from - sharingbuttons.io/
12 13 14 15 16 17 18 19 20 21 |
# File 'app/helpers/integral/social_helper.rb', line 12 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(message)}" if .present? share_url end |
#twitter_url ⇒ String
Twitter Profile URL set from within Backend Settings area
84 85 86 |
# File 'app/helpers/integral/social_helper.rb', line 84 def twitter_url Settings.twitter_url end |
#youtube_url ⇒ String
Youtube Profile URL set from within Backend Settings area
98 99 100 |
# File 'app/helpers/integral/social_helper.rb', line 98 def youtube_url Settings.youtube_url end |