attachment_fu related to another table

Dear all,

I created a site that asks for personal information such as Name, Age,
Etc.. and saves it into a MySQL database table. Now I would like to
link a personal picture to these profiles. I have successfully
implemented a picture upload with attachment_fu. However, all the
picture metadata is saved in the attachment_fu table. What is the best
procedure to link the profile table with the attachment_fu table in
order to retrieve the filename of the picture ? Also, when users want
to change their picture, how do I make sure that the previous picture
gets deleted. Right now attachment_fu keeps adding new pictures.

I could not find examples on the web for this. This must be a common

Thank you,


Use a one-on-one relationship (has_one) with the image table. To replace the existing one: destroy the old one and then create a new one.

Best regards

Peter De Berdt