I'm using attribute_fu and paperclip to add multiple images to a
specific record.
This is working great when creating a new record but when I want to add
new images to an existing record through a common scaffold update, the
images upload but replace the existing images.
Do you have a separate model to hold the additional images? Or do you have N number of image "slots" per record? Paperclip manages each image as a virtual attribute of your model, and if you upload a new image in the same slot, that image will overwrite the previous one. Unless you're adding
I'm using attribute_fu and paperclip to add multiple images to a
specific record.
This is working great when creating a new record but when I want to
add
new images to an existing record through a common scaffold update, the
images upload but replace the existing images.
Do you have a separate model to hold the additional images? Or do you
have N number of image "slots" per record? Paperclip manages each
image as a virtual attribute of your model, and if you upload a new
image in the same slot, that image will overwrite the previous one.
Unless you're adding
Oh, ok. You are ending up with something that is now native to Rails. Attribute_fu seems to be doing what accepts_nested_attributes_for does now. I suspect you can refactor your application to remove that plug-in and move ahead.
Nested forms came into being somewhere in the 2.3 timeframe, so you might want to find a different tutorial that is more up to date. There's an excellent Railscast about them.
You are in fact doing what I thought you needed to -- you have a separate model for your images, and so you can have N number of them related to a single parent model.