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 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 Mathew <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> 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 > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Thanks: Rajeev sharma -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 Mathew <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: > >> >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > > > -- > Thanks: > Rajeev sharmafirst 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 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.