Skip to content

Instantly share code, notes, and snippets.

@rubypirate
Created November 9, 2010 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubypirate/669922 to your computer and use it in GitHub Desktop.
Save rubypirate/669922 to your computer and use it in GitHub Desktop.
jn helper
in the view
=====================
<%= link_to_remote 'click', :update => "share",
:url => { :controller=>'blogs', :action=>'share' },
:complete => visual_effect(:highlight, 'share')
%>
in blogs controller
======================
def share
render :text=>%(
<script type="text/javascript">
RPXNOW.loadAndRun(['Social'], function () {
var activity = new RPXNOW.Social.Activity(
"Share your comment",
"commented on 'Like My New Perfume?' on cuteoverload.com",
"http://cuteoverload.com/2009/10/26/like-my-new-perfume/");
RPXNOW.Social.publishActivity(activity);
});
</script>
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment