You might have seen several icons of social networks in many of the sites. If you want to add this in your rails site, there is already a beautiful gem called social-share-button. I am explaining here how you can integrate it step-by-step.
1) Open your Gemfile and add this code:
gem 'social-share-button', '~> 0.1.6'
2) Now run bundle
3) Install the social share button using the rails generator like this:
rails generate social_share_button:install
## this will create these files
The main configuration file that needs to be configured for social share button is config/initializers/social_share_button.rb
SocialShareButton.configure do |config|
# Here you can customize the number of social icons that are needed in your website
config.allow_sites = %w(twitter email facebook google_plus weibo douban tqq renren qq kaixin001 baidu google_bookmark delicious huaban tumblr plurk pinterest)
4) Now require css and js files in your application.css and application.js respectively like this: