Skip to content

Filestack Form Helper with no options renders javascript syntax error #200

@diegous

Description

@diegous

A form helper like this one

<%= f.filestack_field :image_url, 'Upload Photo' %>

renders this html/js code

<button name="button" type="button" onclick="(function(){
          filestack_client.picker({, onUploadDone: data => (function(data){const filestack_input_field= document.getElementById('nilclass_image_url');filestack_input_field.value = data.filesUploaded[0].url;})(data)}).open()
        })()">
  Upload Photo
</button>
<input id="nilclass_image_url" style="display:none" type="text" name="selfies[image_url]">

The issue is on the object received by the filestack_client.picker function that has a comma preceded by nothing and followed by the onUploadDone callback:

{ , onUploadDone: data => (function(data){...}) }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions