how can i delete image through plugin file_column? -- Posted via http://www.ruby-forum.com/.
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 ????????:> how can i delete image through plugin file_column?
Horacio Sanson 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 -- Posted via http://www.ruby-forum.com/.
Horacio Sanson
2006-May-24 10:04 UTC
[Rails] Re: delete image through plugin file_column ?
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 ????????:> Horacio Sanson 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