Topic: Set default profile photo for users

Hello, distinguished friends.
I am using attachment_fu to allow users of my site to upload photo.
How can I set a default profile photo for user once he registers?
You know, some users may not want to upload a profile photo so that I have to set a default one for them.
Does anyone know how to do that?
Thank you very much and I really appreciate your help.

Re: Set default profile photo for users

I hope this doesn't double post - I thought I already responded to this.... (I'll delete this if the former post pops back up again)

I haven't worked with attachment_fu (I typically use paperclip), but the general idea of what I would do is as follows -

I'm assuming that you have a way with attachment_fu of being able to tell whether a user has uploaded a profile photo or not. Maybe something like User#profile_photo returns nil if there is no profile photo (this is roughly what would happen with paperclip, depending on how you set it up). However that is, what you can do is (whenever you need to load the profile photo) check to see if the user has a profile photo, and if (s)he does not, then just load some default image that you put in your public directory (or wherever). That way you aren't actually loading a photo record unnecessarily, all users have the same image loaded if they don't have a photo loaded. It also means less clean up when you do have a user upload a photo (particularly if you are letting users upload multiple photos) since then you don't have to get rid of the dummy profile photo.