Ok i''ve managed to make it more or less (rather less) work in really
short time, but i''ve got few new questions:
- previously i was saving image name to image_url column, now i decided
to provide option for uploading the files and instead of the name of the
image (string), the whole image is saved to image_url (object:file). How
to get only its name without the path?
BTW. for some images i get object:file and for some object:stringIO in
image_url. Why???
- now user can only add only one image. How to make it so the user can
add i.e. 4 images (should i add [] somewhere in <%= file_field %> to
pass the whole array of images?).
- would it be easy to make the form like that: user sees only one file
input, if he chooses the file, new input appears (with correct name if
it''s necessary) and so on. If he submits the form, all images (except
the empty field) are saved.
- how to delete images (files), if the corresponding product is deleted?
Fields in image table are deleted, but files are not.
--
Posted via http://www.ruby-forum.com/.