Sha256: af9a4f897364293e367783bc5db1f11c859519a899f9244edddcf03eee171d95

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

# Social Share Button

This is a gem to helper you quick create a share feature in you Rails apps.

## Screenshot

![img](http://l.ruby-china.org/photo/00cc56853b29b5d90458d39e855a936d.png)

## Install

in your `Gemfile`:

    gem 'social_share_button'
    
an install it:

    $ bundle install
    $ rails generate social_share_button:install
    
## Configure

you can create this content in `config/initializes/social_share_button.rb`:

    SocialShareButton.configure do |config|
      config.allow_sites = %w(twitter facebook weibo douban)
    end
    
## Usage

you need add require css,js file in your app assets files:

`app/assets/javascripts/application.js`

    //= require social-share-button
    
`app/assets/stylesheets/application.css`

    *= require social-share-button
    
then you can use `social_share_button_tag` helper in views, for example `app/views/posts/show.html.erb`

    <%= social_share_button_tag(@post.title) %>

and you can custom rel attribute:

    <%= social_share_button_tag(@post.title, :rel => "twipsy") %>
    
## Demo

[http://ruby-china.org/wiki/about](http://ruby-china.org/wiki/about)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
social-share-button-0.0.4 README.markdown
social-share-button-0.0.3 README.markdown
social-share-button-0.0.2 README.markdown