Skip to content

Commit

Permalink
Support for uploading multiple images
Browse files Browse the repository at this point in the history
  • Loading branch information
gabifija committed Oct 23, 2020
1 parent 72e4262 commit 4ebf769
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -119,7 +119,7 @@ You can also generate a new security object at any time, although this will only
This is a generic button that can be added anywhere in your application and opens an instance of the File Picker. Once a user has chosen a file(s) and submitted, a callback will be executed, passing in the results. You can also pass in any options for the File Picker using the `pickerOptions` symbol:

```erb
<%= filestack_picker_element 'button test', 'callbackForButton', id: 'someuniqueid', input_id: 'someuniqueinputid', pickerOptions: { 'fromSources' => 'facebook' } %>
<%= filestack_picker_element 'button test', 'callbackForButton', id: 'someuniqueid', input_id: 'someuniqueinputid', pickerOptions: { 'fromSources' => 'facebook', 'maxFiles': 50 } %>
```
File Picker options are exactly the same as in the Javscript SDK and can be found in the aforementioned documentation.

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/filestack_rails/form_helper.rb
Expand Up @@ -17,7 +17,7 @@ def get_filestack_field_button(method, content, options = {})

form_field_callback_guts = 'const filestack_input_field' \
"= document.getElementById('#{input_options[:id]}');" \
'filestack_input_field.value = data.filesUploaded[0].url;'
'filestack_input_field.value = data.filesUploaded.map(e => e.url);'

unless user_callback.nil?
form_field_callback_guts = "#{form_field_callback_guts}#{user_callback}(data)"
Expand Down

0 comments on commit 4ebf769

Please sign in to comment.