# Delete image through plugin file\_column?

**URL:** <https://www.ruby-forum.com/t/delete-image-through-plugin-file-column/61467>\
**Category:** Rails\
**Created:** [May 24, 2006, 8:25am UTC](https://www.ruby-forum.com/t/delete-image-through-plugin-file-column/61467 "2006-05-24T08:25:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilyas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/f04885/32.png) [@ilyas](https://www.ruby-forum.com/u/ilyas)\
**Post date:** [May 24, 2006, 8:25am UTC](https://www.ruby-forum.com/t/delete-image-through-plugin-file-column/61467/1 "2006-05-24T08:25:10Z")

</div>

how can i delete image through plugin file\_column?

---

<div class="post-metadata">

**Author:** ![ilyas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/f04885/32.png) [@ilyas](https://www.ruby-forum.com/u/ilyas)\
**Post date:** [May 24, 2006, 8:56am UTC](https://www.ruby-forum.com/t/delete-image-through-plugin-file-column/61467/2 "2006-05-24T08:56:59Z")

</div>

If you call destroy to the model that has the file\_column the image will  
be  
deleted.

Horacio

Wednesday 24 May 2006 15:25ã?Ilyas ã?ã??ã¯æ?¸ãã¾ã?ã?:

---

<div class="post-metadata">

**Author:** ![ilyas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/f04885/32.png) [@ilyas](https://www.ruby-forum.com/u/ilyas)\
**Post date:** [May 24, 2006, 9:12am UTC](https://www.ruby-forum.com/t/delete-image-through-plugin-file-column/61467/3 "2006-05-24T09:12:46Z")

</div>

Horacio S. wrote:

> If you call destroy to the model that has the file\_column the image will  
> be  
> deleted.
> 
> Horacio
> 
> Wednesday 24 May 2006 15:25ã?Ilyas ã?ã??ã¯æ?¸ãã¾ã?ã?:

but if I have file only in tmp directory, and didn’t yet saved Image  
class

---

<div class="post-metadata">

**Author:** ![ilyas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/f04885/32.png) [@ilyas](https://www.ruby-forum.com/u/ilyas)\
**Post date:** [May 24, 2006, 12:06pm UTC](https://www.ruby-forum.com/t/delete-image-through-plugin-file-column/61467/4 "2006-05-24T12:06:04Z")

</div>

I have a profile model with a file\_column in there like this:

class Profile \< ActiveRecord::Base  
belongs\_to :user  
file\_column :image, :magick =\> { :versions =\> { “small” =\>  
“60x70”} }  
translates :description  
end

When I create a new profile, upload an image and save then it  
automaticly  
creates a folder like public/profile/id/filename.jpg where id is the  
profile  
id and filename is the uploaded image file name.

When I call destroy to this profile object the created directory also  
disappears completely deleting the image.

If this is not the case for you then something must be wrong, try to  
update  
the file\_column plugin.

regards,  
Horacio

Wednesday 24 May 2006 16:12ã?Ilyas ã?ã??ã¯æ?¸ãã¾ã?ã?:
