Link_To_Remote Incrementing

If you name all your inputs "image[]", you'll get an array back in params.

You might want to look at this as well:

Pavel Tzun wrote:

The array isn't the problem at hand. My problem is making the <input type="file"> have names that increment when you click the "add image"

I'm not sure why you need to increment the number. Just name it "image[]" and it will be an array instead of a hash when the params receive it. Something like this should work:

<div id="upload">
   <%=file_field_tag 'image[]'%>
   <%=link_to_function 'Add Another', "new Insertion.Bottom('upload',
     escape_javascript(file_field_tag 'image[]'))"%>

The above is not tested but something like that should work.