Hi!
I’ve got 2 models - let’s call them User and Image. User has_many
images. (Thanks to Mark Reginal James ) I have a single form where i
can create a user and add to him any number of images, which are
uploaded using file_column plugin.
Now 3 questions:
-
How to change the default path where file_column plugin saves images,
so it will save them in a directory, which name is not image id, but
user id to which the image belongs to? -
When user objects fails validation, but images were ok, i’d like to
display thumbnails of temporarly uploaded files by file_column, so that
user can see that they were acutally correctly uploaded. What is the
name of the variable in file_column that keeps path to the images and
how to access it from the view? -
What is the best way to automatically delete files in the “tmp”
folder? It gets huge very quickly. I don’t think that scheduling
deleting of these files is good solution, because user could be filling
his form while tmp folder is being deleted. Maybe i could somehow add a
callback that it will delete temporary image if it was succesfully
saved? But how?
That’s all. Thanks in advance.