Modern browsers natively suppport file pickers that allow the user to choose multiple files at once. To activate this feature, set the multiple
attribute:
<input type="file" name="images[]" multiple />
Or in a Rails view:
<%= file_field_tag "images[]", multiple: true %>
This works in IE10+.
Make sure that the field name ends in []
so your server-side code will parse the incoming files into an array. Obviously this naming convention is not compatible with default Rails nested attribute setters, so you'll need to write a form model to adapt.
Posted by Henning Koch to makandra dev (2014-10-21 08:38)