filestack/filestack-rails

Multiple filestack forms causes it to not submit and save

Closed this issue · 5 comments

I've noticed that if i have multiple forms in the page.

ie. 1 form to create a new post and another to update previous posts, it won't work.

Is this a known problem?

CODE: http://prntscr.com/iimkda

The first block of code will submit the photo and do everything correctly.

The second block of code won't, even though they're exactly the same.

Edit: When I upload a file using FORM B, the upload goes to FORM A instead of From B.

Are you guys planning on doing a fix for this? This problem is effecting the user experience of my software.

@masondesu I took a look on your code, and I reproduced your issue in my test rails app.
Instead of using id: 'unique-id', you should write input_id: 'unique-id'.

Could you please use filestack_field as follow:
<%= f.filestack_field :image_url , 'Upload', input_id: 'unique-id', required: true %>

Let me know if that helps.

@gabifiolek I'm guessing you meant to tag @masudhossain instead of me :)

@masondesu hahaha, yes! :) thank you for quick response!
cc @masudhossain
and also here is a source code:

input_options[:id] = filestack_input_field_id(method, options[:input_id])
;)