# Attachment\_fu 'replace' method?

**URL:** <https://www.ruby-forum.com/t/attachment-fu-replace-method/122034>\
**Category:** Rails\
**Created:** [December 4, 2007, 12:28am UTC](https://www.ruby-forum.com/t/attachment-fu-replace-method/122034 "2007-12-04T00:28:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nextpulse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/71c47a/32.png) [@nextpulse](https://www.ruby-forum.com/u/nextpulse)\
**Post date:** [December 4, 2007, 12:28am UTC](https://www.ruby-forum.com/t/attachment-fu-replace-method/122034/1 "2007-12-04T00:28:26Z")

</div>

Is there a ‘replace’ method or similar for attchment\_fu?  
For instance, I have an image that is uploaded and stored. Now I want  
to replace it with a different image.

I do not want to do a delete and then new - since I need to keep  
various attributes associated with the previous image.

thanks.

---

<div class="post-metadata">

**Author:** ![nextpulse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/71c47a/32.png) [@nextpulse](https://www.ruby-forum.com/u/nextpulse)\
**Post date:** [December 4, 2007, 12:52am UTC](https://www.ruby-forum.com/t/attachment-fu-replace-method/122034/2 "2007-12-04T00:52:59Z")

</div>

Or how would I use update to do this?

---

<div class="post-metadata">

**Author:** ![nextpulse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/71c47a/32.png) [@nextpulse](https://www.ruby-forum.com/u/nextpulse)\
**Post date:** [December 4, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/attachment-fu-replace-method/122034/3 "2007-12-04T21:51:25Z")

</div>

On Dec 3, 2007 5:28 PM, nextpulse [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there a ‘replace’ method or similar for attchment\_fu?  
> For instance, I have an image that is uploaded and stored. Now I want  
> to replace it with a different image.
> 
> I do not want to do a delete and then new - since I need to keep  
> various attributes associated with the previous image.

Have you considered using acts\_as\_versioned ?

[http://wiki.rubyonrails.org/rails/pages/ActsAsVersioned](http://wiki.rubyonrails.org/rails/pages/ActsAsVersioned)

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)
