Search code examples
ruby-on-railsfacebookerfacebooker2

Ruby on Rails: how to use facebooker2 to get profile pictures from users when they are not logged in on my app


So I am playing with facebooker2. I already know how to display current user's profile picture when they are logged in. However, I am interested in display the profile pictures of other users on my app as well. I was wondering if anyone knows how to do this? I have asked for offline permission already, but I am not really sure what would be the next step.

Could anyone please give some hints maybe? Thank you very much!


Solution

  • If you have facebook uid of user then you can show his picture. You don't need any permission for this.

    With facebooker2 you have helper as fb_profile_pic(facebookUserUid, OptionHash)

    by this way following code works for me-

    <%= fb_profile_pic(current_facebook_profile.id, {:size => 'square' }) %>
    

    For offline users -

    <%= fb_profile_pic(user.fb_user_uid, {:size => 'square' }) %>
    

    As i store facebook uid in fb_user_uid column.