Uploading of file is super, but problem began when you try to set image from local file system. I found simple and nice solution on this blog, but this solution doesn't work.
So, I made some changes to original script and you should use these simple commands.
coppied_area = Area.find(params[:coppied_area]) # original record
@area = coppied_area.clone # create copy
@area.day_foto = File.open coppied_area.day_foto unless coppied_area.day_foto.nil? # add image when existing
New file_column.rb should be downloaded here.
Žádné komentáře:
Okomentovat