facebook_session.user.friends_with_this_app.map(&:id).join(","); how can I do such thing in Facebooker2
<%= fb_multi_friend_selector("Invite your friends to check out this site", :showborder => true,:exclude_ids => facebook_session.user.friends_with_this_app.map(&:id).join(","), :condensed => false) %>
as you see above , :exclude_ids => facebook_session.user.friends_with_this_app.map(&:id).join(","),
this line can remove the friends who had been a friends of you and joi开发者_开发技巧ned in the app listed there. Recently, I upgraded to Facebooker2. how can I do the same thing in Facebooker2?
there is no function named friends_with_this_app in Facebookers and Mogli.
I haven't been able to figure out a one step solution to this. However you could do:
<% every_friend = current_facebook_user.friends.map(&:id) %>
# replace user with your class and fb_id with your user's facebook id field name
<% app_friends = User.where( :fb_id => every_friend ).map(&:id) %>
then your code
<%= fb_multi_friend_selector("Invite your friends to check out this site", :showborder => true,:exclude_ids => app_friends, :condensed => false) %>
精彩评论