Search code examples
ruby-on-railsfacebooksocialshare

social-share-button popup instead of opening new tab


I'm using social-share-button for my project.

When clicking the buttons, it opens a new tab to share, is there any way to make it as pop up instead of opening to a new tab?

<%= social_share_button_tag("my title", :url => "http://this is a test url") %>

should be something like facebook share plugin. Clicking the share button just opens a small pop up window, and after sharing it closes.

or anyone can lead me to a better rails gem to help me with facebook/twitter sharing?


Solution

  • In the documentation of this gem you could pass a block of argument in the function you are calling to generate your link like in this example

    <%= social_share_button_tag(@post.title, :name => "galao", :target => "_blank" other =>"other block as you wish") %>
    

    No social_share_button is the only one that I know but as it doesn't displays 100% as you like you could try instead implementing a javascript library instead.

    you could use any javascript libraries for the popup

    have you try https://github.com/sonnyt/prettySocial demo

    jquery-plugin for social

    ...have you look at ruby-toolbox in case there is one that could fit your needss