2011-05-26 67 views
0

我試圖在我的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上的加載指示器,但它似乎永遠存在。 有什麼我在這裏失蹤?請幫忙!

+0

這似乎是FBML,我認爲這已被棄用。我分享了我用來發布在牆上的代碼,並使用多朋友選擇器邀請朋友。 – 2011-05-26 14:53:15

回答

1
<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

相關問題