Prevent transloadit-rails overlay and progres bar to show when no file is attached

88 views Asked by At

In a form where it's optional to attach an image When there is no image attached and the user submits the form Then transloadit overlay and progress bar is shown Then the submission form hangs when it reaches 100%

I want to prevent overlay and progress bar from showing when there is no file to upload

1

There are 1 answers

0
Matt Long On

The answer for me was to add the processZeroFiles: false parameter to the jquerify function. Like this:

<%= transloadit_jquerify :upload, :wait => true, processZeroFiles: false %>

I then had to ensure the params[:transloadit] parameter existed in my controller before trying to access it since it non longer hits transloadit every time I update or create an instance of my model object.

Comment Typo

Notice that the parameter is actually processZeroFiles and not progressZeroFiles as mentioned in the comment on the question by @kvz.