Skip to content

Instantly share code, notes, and snippets.

@ptescher
Created November 27, 2010 20:08
Show Gist options
  • Save ptescher/718223 to your computer and use it in GitHub Desktop.
Save ptescher/718223 to your computer and use it in GitHub Desktop.
def get_user_image(user)
image_html = ""
unless user.nil?
if user.avatar?
image_html += image_tag(user.avatar.thumbnail, {:height=>'50px',:width=>'50px'})
elsif user.fb_user_id
image_html += '<fb:profile-pic linked="false" uid="' + user.fb_user_id.to_s + '" size="square" ></fb:profile-pic>'
else
image_html += gravatar_for(user)#"/images/default_user.png" height="50px"
end
end
return image_html
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment