[英]Image upload in Ruby on Rails using remotipart gem and Paperclip
I am having a form submit in which the user can be able to choose multiple images( choosing one by one ) not multiple enabled in file field. 我正在提交一个表单,其中用户可以选择多个图像(一个一个地选择),而不是在文件字段中启用多个图像。
When the user chooses the image I will add an image tag for image preview and hidden file field for each of the images added. 当用户选择图像时,我将为图像预览添加一个图像标签,并为每个添加的图像添加一个隐藏文件字段。
When the validation fails in back end it just removes a file field. 当后端验证失败时,它只会删除一个文件字段。 This removes a file field for each time when validation error occurs(any field validation).
每次发生验证错误(任何字段验证)时,都会删除一个文件字段。 Anything better can be done for this?
有什么更好的办法吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.