0.0
No commit activity in last 3 years
No release in over 3 years
Easily create sharing links for all of the major social networks using a simple link_to_social tag.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

~> 3.2.0
 Project Readme

link_to_social

This gem adds a special link_to_social method to the Rails view helpers to easily make a regular link into a social sharing link.

If you're unsure of what this means, try clicking on of these example links:

Share link_to_social on LinkedIn

Share link_to_social on Facebook

Usage

Add the gem to your Rails project's Gemfile, then bundle install to get started.

gem 'link_to_social'

To use link_to_social inside your views:

link_to_social "Share Google on Facebook", "http://google.com", network: :facebook

link_to_social "Share Google on Twitter", "http://google.com", network: :twitter

Network options are passed as symbols. Acceptable network options include:

:facebook
:twitter
:linkedin
:googleplus
:tumblr

Some social networks also include optional parameters to include more information with your link, which have been added explicitly as options to link_to_social. Here are some examples:

link_to_social "Share Google on Twitter", "http://google.com", network: :twitter, text: "Google is awesome."

link_to_social "Share Google on LinkedIn", "http://google.com", network: :linkedin, title: "Great Pandas", source: "http://pandafarm.com"

link_to_social("Share Google on Tumblr", "http://google.com", network: :tumblr, name: "A great post.", source: "http://zfeldman.com"

Contributing to link_to_social

Pull requests welcome.

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so we don't break it in a future version unintentionally.
  • Send in a pull request!

Credits

githalytics.com alpha