Social Share Button Gem for Rails Apps
Install social share button for your Rails app in just 5 minutes.
Add the gem to the Gemfile.
Install the gem and generate the config files.
$ bundle install $ rails generate social_share_button:install
//= require social-share-button
Add the import statement for the CSS in application.scss file:
Add the share button helper to article show page:
<%= social_share_button_tag(@article.title) %>
You will now see the social media share buttons as seen on this page.
In this article, you learned how to use the social-share-button gem to add social share buttons to your Rails app.