2011-02-11 109 views
1

嘿,我使用facebooker gem连接到facebook。它的一切工作正常,除了我不能设置我希望用户允许的perms的事实。Facebooker Rails - fb_login_button无法设置烫发

虽然我通过offline_access权限,当弹出窗口打开时,它只显示基本信息权限。

代码从我的观点

<%= fb_connect_javascript_tag %> 
<%= init_fb_connect "XFBML"%> 
<%= fb_login_button("window.location = 'some_url';", :perms => "offline_access")%> 

产生

<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> 
<script type="text/javascript"> 

     Event.observe(window,'load', function() { 
      FB_RequireFeatures(["XFBML"], function() { 
       FB.init('myapikey','/xd_receiver.html', {}); 

      }); 
      }); 

</script> 
<fb:login-button onlogin="window.location = 'http://localhost:3000/users/show';" permissions="offline_access"></fb:login-button> 

回答

0

这是行不通的。 您需要通过init_fb_connect的权限,如

init_fb_connect "XFBML", { :js => :jquery, :app_settings => " { permsToRequestOnConnect : 'status_update,user_events' }" }