RailsCasts Pro episodes are now free!

Learn more or hide this

Pete Bevin's Profile

GitHub User: pbevin

Site: http://www.petebevin.com

Comments by Pete Bevin

Avatar

I found that in Rails 4, setting name: in f.file_field didn't work: Rails appended [] to the end of the field name regardless. I had to replace this:

    <%= f.file_field :image, multiple: true, name: "painting[image]" %>

with plain HTML, like this:

    <input id="painting_image" multiple="multiple" name="painting[image]" type="file" />