filestack / filestack-rails

Official Ruby on Rails plugin for Filestack File Picker that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
Apache License 2.0
223 stars 102 forks source link

Multiple filestack forms causes it to not submit and save #182

Closed masudhossain closed 5 years ago

masudhossain commented 6 years ago

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?

masudhossain commented 6 years ago

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.

masudhossain commented 6 years ago

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

gabifija commented 5 years ago

@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.

mason-stewart commented 5 years ago

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

gabifija commented 5 years ago

@masondesu hahaha, yes! :) thank you for quick response! cc @masudhossain and also here is a source code: https://github.com/filestack/filestack-rails/blob/a66c79224afafe1f9e67840f807635b824f7d23f/app/helpers/filestack_rails/form_helper.rb#L13 ;)