current user name in example

4 views
Skip to first unread message

Victor

unread,
Dec 29, 2011, 12:39:43 PM12/29/11
to facebooker
Hi,

I'm setting up an FB connect app, and found that the
current_facebook_user.first_name and current_facebook_user.last_name
weren't returning a value. I think it is because the mogli user in
FB2 is an initialized user rather than a "found" user (created from
Mogli::User.find) and as such the facebook api hasn't been called and
the values haven't been populated.

Could someone please confirm my understanding?

I think including sample code that behaves unexpectedly (I would have
expected to see the name) is confusing. Any thoughts about removing
this line or adding a comment that the user needs to be "found"?

Specifically the line in question is:

<%= "Welcome #{current_facebook_user.first_name}
#{current_facebook_user.last_name}!" %>

Happy pre-new year,

~Victor

Mike Mangino

unread,
Dec 29, 2011, 12:54:32 PM12/29/11
to faceb...@googlegroups.com
That is correct. Fetching that information would require a remote server call. If you want to do that, you can call fetch. I would instead recommend storing the data locally and using the subscription methodology for getting updates for your users.

Mike

> --
> You received this message because you are subscribed to the Google Groups "facebooker" group.
> To post to this group, send email to faceb...@googlegroups.com.
> To unsubscribe from this group, send email to facebooker+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/facebooker?hl=en.
>

Reply all
Reply to author
Forward
0 new messages