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
problem.

Thank you,

Nick,

On 19 Sep 2007, at 02:47, Nick wrote:

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs