Basically what I would like to do is:
- Get Facebook friends of current user
- Give this collection, differentiating users who are already registered in my application, to other users, adding to each element of this collection the attribute 'registered' set to
true or false
I managed to find the Facebook friends of the current user and assign them to my application.
Usercontroller
def facebook_friends @friends = graph.get_connections("me", "friends") end
RABL
object false node :data do @friends end
It returns something like:
{ data: [{ 'id': '23456789' 'name': 'Bobby Brown' }, { 'id': '23456788' 'name': 'Bobby Black' }] }
but I would like something like this:
{ data: [{ 'id': '23456789' 'name': 'Bobby Brown', 'registered': true }, { 'id': '23456788' 'name': 'Bobby Black', 'registered': false }] }
But I do not know how to make the second part without spending extra resources.
source share