Jacky
Jacky

Reputation: 49

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!

Upvotes: 0

Views: 792

Answers (2)

egze
egze

Reputation: 3236

if you need the small avatar, then just do it with the image tag

<%= image_tag "http://graph.facebook.com/#{@user.facebook_id}/picture" %>

Upvotes: 2

rtdp
rtdp

Reputation: 2107

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.

Upvotes: 1

Related Questions