In Rails 6 I have a form with a file field and I am using activestorage to store the file. If validations fail after submitting the form, the form is redisplayed showing the validation errors. How can I retain the file added to the file field when redisplaying the form so that the user does not have to add the file again to the form?
There is already a similar question for rails 5: Active Storage: Best practice to retain/cache uploaded file when form redisplays, however the solution there only applies to Rails 5.