BACKGROUND: Each user has their Facebook profile image URL associated with their account. This image is called using <%= image_tag(@user.facebook_image_url) %>
.开发者_开发百科 Each user's Facebook URL takes the following form: http://graph.facebook.com/123456/picture - with 123456 being the user's particular Facebook ID number.
OBJECTIVE: I'd like to prevent other users from being able to figure out who the user is simply by right-clicking 'copy image url' and looking at the ID in the image URL.
Is there a gem/plugin or better way to accomplish this other than downloading the user's image from Facebook's servers?
AFAIK, there are only two options: Either you download the image as you say and deliver it to the browser with your own url, or you let the browser do the work in which case the browser (and it's user) has to know the url.
Have a look at Get Facebook real profile image URL. It seems, facebook performs some kind of redirecting. Perhaps you can use that for your purpose.
精彩评论