It adds the "" so the parameter is an array (if you don't add that, params[:avatar] will be only one file and not an array). I'm not sure why but the helper does not infer that, you have to be explicit on that.
El vie., 13 sept. 2019 a las 12:34, fugee ohu (<[hidden email]>) escribió:
I read this example for the form:
<%= p.file_field :avatar, :multiple => true, name: "post_attachments[avatar]" %> Why is the name argument necessary Why can't the controller just get the array from <%= p.file_field :avatar %> ?
My understanding is that the helpers do the "80%" solution for you -- pave the cowpaths -- but expect you to do the edge cases yourself, since you know what you are doing and what you want. Too much "magic" breeds a complacent user that expects everything to just work, all the time, which is unreasonable for the simple fact that software cannot read minds.