# Problems with attachment\_fo and images update

**URL:** <https://www.ruby-forum.com/t/problems-with-attachment-fo-and-images-update/132546>\
**Category:** Rails\
**Created:** [March 21, 2008, 9:27am UTC](https://www.ruby-forum.com/t/problems-with-attachment-fo-and-images-update/132546 "2008-03-21T09:27:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stratboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@stratboy](https://www.ruby-forum.com/u/stratboy)\
**Post date:** [March 21, 2008, 9:27am UTC](https://www.ruby-forum.com/t/problems-with-attachment-fo-and-images-update/132546/1 "2008-03-21T09:27:41Z")

</div>

I have installed attachment\_fu and i have use this tutorial for change  
the path\_prefix:  
[http://the.railsi.st/2007/8/21/how-to-customize-attachment\_fu-file-names](http://the.railsi.st/2007/8/21/how-to-customize-attachment_fu-file-names)

the path of images+thumbnail are:  
/images/cores/fullsize/  
/images/cores/thumb/  
/images/cores/thumb\_big/

when i create a new attachment object it works, the images are insert  
inthese directory.

But when i edit a object (changing also the image), new thumbnail images  
are insert not correctly.  
Are insered in fullsize directory with a different name.

Why?

I update the attachment in my controller with:  
@user.photo=Photo.new(params[:user][:photo]) unless  
params[:user][:photo].empty?

Is correct?  
Thanks
