Created
February 22, 2011 14:42
-
-
Save Holek/838761 to your computer and use it in GitHub Desktop.
Instructions and examples for facebook_share gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
include FacebookShare | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="fb-root"></div> | |
<!-- assuming you have set your Facebook application ID --> | |
<div id="some"> | |
<%= link_to 'Share on Facebook', '#', :class => "fancy_selector" %> | |
</div> | |
<%= facebook_share_once :selector => "#some > .fancy_selector" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="fb-root"></div> | |
<div id="some"> | |
<a href="#" class="fancy_selector">Share on Facebook</a> | |
</div> | |
<script type="text/javascript" src="https://connect.facebook.net/en_US/all.js"></script> | |
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
FB.init({appId:"753498454209523"}); | |
$("#some > .fancy_selector").unbind("click.facebook_share").bind("click.facebook_share",function () { | |
FB.ui({ | |
method: 'stream.publish', | |
link: "http://railslove.com", | |
display: "popup" | |
}); | |
return false; | |
}); | |
/* ]]> */ | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= link_to 'Share on Facebook', '#', :class => "fb_share" %> | |
<script type="text/javascript"> | |
<%= facebook_share :link => "http://link.to/current_site/to_share" %> | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="#" class="fb_share">Share on Facebook</a> | |
<script type="text/javascript"> | |
$(".fb_share").unbind("click.facebook_share").bind("click.facebook_share",function () { | |
FB.ui({ | |
method: 'stream.publish', | |
link: "http://link.to/current_site/to_share", | |
display: "popup" | |
}); | |
return false; | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= facebook_connect_js_tag %> | |
<script><%= facebook_init_script %></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://connect.facebook.net/pl_PL/all.js"></script> | |
<script>FB.init({appId:"42423423423432", status: "true", cookie: "false", xfbml: "true"});</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment