I'm still looking for an elegant multi-file download for Rails.
I just found out about "input type =" file "multiple"
Does Rails support this? Any examples? implementation tips for uploading multiple photos to a photo album model in Rails?
thank
What you need to do is sleep more like this:
<% = f.file_field: attachment: multiple => true%>
It is easy on the rails. If you use form_for, do it like this:
form_for
form_for(@user, :html => {:multipart => true}) do |f|
If you do this with help form_tag, it works like this:
form_tag
form_tag new_user_path, :multipart => true
Hope this helps!
http://www.fyneworks.com/jquery/multiple-file-upload/, jQuery-1.7.1.
Hope this helps.
Here's the full snippet of working code for Rails 5:
<%= form_for(@user, html: {multipart: true}) do |f| %> <%= f.file_field :picture, accept: 'image/png,image/gif,image/jpeg,image/jpg', multiple: true %> <%= f.submit 'Upload Picture' %> <% end %>
Source: https://habr.com/ru/post/1771130/More articles:How to change the value of an HTML element using javascript? - javascriptHow to add a primitive property to an existing Java storage object to throw an exception from a null pointer - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1771127/anyone-know-the-lifespan-of-a-facebook-api-access-token&usg=ALkJrhgohVtba8_rO4Ft4cGdZV7fsywxlASQL query to group data from two tables - sqlHelp check two words, and then print the cross, where the same characters are - javaReading children using C # from xml - c #Write Euler's Method in Mathematica - mathhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1771133/how-come-facebooks-graph-api-issue-a-cookie-for-accesstoken-secret-sessionkey-sig-so-many-fields&usg=ALkJrhgwVCIiKGxYjmeZABxiVnEPLF60sQGoogle API for objective-c - apiIs it easy to understand and follow jQuery and javascript books? - javascriptAll Articles