I have an array of the current_user’s FB friends and another of other users that belong to a given event.
I need to find all of the current_user’s FB friends that also belong to the event.
Tried this in my events_controller:
@friends = Array.new
@the_others = Array.new
@event.users.each do |user|
@fb_user.friends.each do |friend|
if friend.identifier == user.uid
@friends << user
else
@the_others << user
end
end
end
Clearly this is way off…in fact it’s not working…someone please set me straight 🙂
Try this