Facebook多朋友选择器不适用于RoR应用程序
问题描述:
我试图在我的Ruby on Rails应用程序中实现Facebook多朋友选择器。 FB登录已完成。我试图将this代码粘贴到我的视图中,但似乎没有工作。Facebook多朋友选择器不适用于RoR应用程序
<fb:serverFbml>
<script type="text/fbml">
<fb:fbml>
<fb:request-form
method='POST'
type='an invitation to do this.'
content='I invite you to do this.
<fb:req-choice url="http://apps.facebook.com/smiley/yes.php" label="Yes" />
<fb:req-choice url="http://apps.facebook.com/smiley/no.php" label="No" />'
<fb:multi-friend-selector actiontext="I invite you to do this.">
</fb:request-form>
</fb:fbml>
</script>
</fb:serverFbml>
我可以看到Facebook上的加载指示器,但它似乎永远存在。 有什么我在这里失踪?请帮忙!
答
<div id="facebook_invites" class="conclusion" style="width: 750px; text-align: center">
If you like <%= link_to "BillBaba.com", "/", :target => "_BLANK" %>, then please help us by spreading the word.<br/>
<a id="wall_post" href="#" style="font-size: 2em;">Post on your Wall</a><br/>
<a id="invite_friends" href="#" style="font-size: 1.5em;">Invite your Friends</a>
</div>
<div id="fb-root"></div>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
$('#wall_post').click(function() {
FB.init({
appId:'<%= @app_id %>', cookie:true,
status:true, xfbml:true
});
FB.ui({ method: 'feed',
link: 'http://www.billbaba.com',
picture: 'http://www.billbaba.com/images/logo.gif',
description: 'There is so much more to life, other than bill payments. Try BillBaba.com and never miss another bill payment.',
name: 'BillBaba.com'});
});
$('#invite_friends').click(function() {
FB.init({
appId:'<%= @app_id %>', cookie:true,
status:true, xfbml:true
});
FB.ui({ method: 'apprequests',
message: 'There is so much more to life, other than bill payments. Try BillBaba.com and never miss another bill payment.'});
});
</script>
这里@app_id是从控制器传递的应用程序ID。
+0
有没有关于此的任何Facebook文档,从哪里我可以阅读更多? – Themasterhimself 2011-05-26 15:05:25
+0
你可以在这里找到它:http://developers.facebook.com/blog/post/464/ 和这里:http://developers.facebook.com/docs/channels/#requests – 2011-05-26 15:08:38
这似乎是FBML,我认为这已被弃用。我分享了我用来发布在墙上的代码,并使用多朋友选择器邀请朋友。 – 2011-05-26 14:53:15