bullet-train-co / bullet_train

The Open Source Ruby on Rails SaaS Template
MIT License
1.68k stars 269 forks source link

File fields with `multiple` don't behave quite right #1604

Closed jagthedrummer closed 4 months ago

jagthedrummer commented 4 months ago

If you super scaffold a model with a file_field attribute and pass {multiple} it mostly does the right things, but not completely.

rails g super_scaffold Widget Team name:text_field files:file_field{multiple}

Currently you're only able to upload one document at a time.

When creating a record you'll see a button for "Upload New Document"

CleanShot 2024-07-12 at 09 49 20

After selecting a file, you don't have any indication of the file name that you're about to upload, and you get a button saying "Select Another File", but when you click it you're actually selecting a different file instead of an additional file. It replaces whatever you'd selected previously.

CleanShot 2024-07-12 at 09 50 38

After saving and then re-editing the record you'll get an "Upload New Document" button, which does let you choose an additional file to upload.

CleanShot 2024-07-12 at 09 52 52

You can use that to select another file which will be saved along side the previously uploaded one.

At any time you're able to select multiple files to upload via the file picker, but after doing so there's no indication that you're uploading more than one file, no indication of the names of the files you're about to upload, and there's no way to cancel any of them.