Easily create sharing links in Rails for all of the major social networks using a simple link_to_social tag.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



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


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:


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!


githalytics.com alpha