Paper clip plugin (dleting attachments)

Hi All,
i created an application to upload image files using paper clip
plugin,its working successfully,alsoi had a page which l;ists all
the images uploaded by the user.also there is a delete button to delete
the image from db by entering value in the deleted_at fileld in
database not removing that complete row( not from the attachments
files(ie images folder)).but when i tried to delete an image its
getting removed from the images folder under public,can any one
suggest any method to avoid the image not getting deleted from the
public folder

please help me

Thanks in advance,
tony

Try some thing like this
invoke this kind of method when needs to delete picture

def delete_photo
@object= User.find(params[:id])
@object.update_attribute(:photo, nil)
@object.save
redirect_to @object
end

On Thu, Aug 26, 2010 at 10:24 AM, Tony M. [email protected]
wrote:

To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Thanks:
Rajeev sharma

rajeevsharma86 wrote:

Try some thing like this
invoke this kind of method when needs to delete picture

def delete_photo
@object= User.find(params[:id])
@object.update_attribute(:photo, nil)
@object.save
redirect_to @object
end

On Thu, Aug 26, 2010 at 10:24 AM, Tony M. [email protected]
wrote:

To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Thanks:
Rajeev sharma
first of all thanks for the valiant effort and reply, but that didnt
works for me,bcos i told u that when i delete like that i am losing the
attached file from mu public/pictures folder.is there any possible way
to preevent that. i think something related to plugin.can any one
knows this?
Thanks n advance,
Tony

sir actuallly the problem is in my model i am using has_attached_file,
in its helper definition its deleting files from my public folder.so
its getting deleted. is thre any methode to override that?