Jssocials::Rails
jsSocials is a simple social network sharing jQuery plugin.
This gem was built for the ease use of jsSocials in Rails projects.
Installation
Add this line to your application's Gemfile:
gem 'jssocials-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jssocials-rails
Usage
Add this line to your application's app/assets/javascripts/application.js:
//= require ...
//= require jssocials # or jssocials.min
//= require ...
Add this line to your application's app/assets/javascripts/application.scss:
...
@import 'jssocials';
@import 'jssocials-theme-flat';
...
Finally, add the share container tag to your application's some view template file as follows:
<div id='share'></div>
and, add this coffeescript to your application's some coffeescript file as follows:
$ ->
...
$('#share').jsSocials
url: 'http://your-domain'
text: 'your share message'
showCount: (screenWidth) ->
screenWidth > 1024
showLabel: (screenWidth) ->
screenWidth > 1280
shares: [
'email'
'twitter'
'facebook'
'googleplus'
'linkedin'
'pinterest'
]
That's it.
Changelog
- v 0.2.0.0 : Initially deployed to Rubygems.org
Contributing
- Fork it ( https://github.com/[my-github-username]/jssocials-rails/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request