如何在导轨验证错误后保留文件上传字段。 [英] How to persist file upload fields after a rails validation error.
问题描述
我基本上有多个文件上传的表单,问题是当我提交表单并发生验证错误时,文件输入字段被重置。我希望将这些文件保存在文件输入字段中,以完成整个过程。
我也经历了几个链接
请让我知道在这种情况下,可以按照什么样的各种选项。
Carrierwave是一个处理文件上传的好工具, https://github.com/jnicklas/carrierwave#making-uploads-work-across-表单重新显示
I have form with multiple file uploads, The issue is when i am submitting the form and an validation error occurs, the file input field gets reset.
I basically wanted to persist those files inside the file input field for the complete process.
I have also gone through few links
How can I "keep" the uploaded image on a form validation error?
Please let me know what are the various options in such cases that one can follow.
Carrierwave is a great tool for handling file uploads and can handle this for you
https://github.com/jnicklas/carrierwave#making-uploads-work-across-form-redisplays
这篇关于如何在导轨验证错误后保留文件上传字段。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!