0.0
No commit activity in last 3 years
No release in over 3 years
Easy helper methods for adding custom social share buttons (Facebook, Twitter, Google+) to your Rails app.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

SocialShare

Easy helper methods for adding custom social share buttons (Facebook, Twitter, and Google+) to your Rails app.

Installation

Add this line to your application's Gemfile:

gem 'social_share'

And then execute:

$ bundle

Or install it yourself as:

$ gem install social_share

Usage

in application.js

//= require 'social_share'

in application.css

*= require social_share

The current social service options are [:facebook, :twitter, :google_plus, :pinterest, :reddit, :tumblr, :stumbleupon]

The social_share method takes a title, a url, and an optional services argument (defaults to Facebook and Twitter) as well as an optional more_services option (defaults to everything except Facebook and Twitter).

<%= social_share(@video.title, video_path(@video), services: [:facebook, :twitter, :google_plus]) %>

Gotchas

The Pinterest button will only be generated if you include the optional image argument:

<%= social_share(@video.title, video_path(@video), image: 'https://placekitten.com/g/500/300') %>

Contributing

  1. Fork it ( https://github.com/ldewald/social_share/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request