All threads / Multiple File Uploads with a nice JS interface?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Multiple File Uploads with a nice JS interface?

Dan Tappin asked in General

I am going with an 'Attachment' model which belongs to other models (just one for now).

The 'Attachment' model to add other fields and funtionality down the road. Each record has one file uploaded against it.

I started with ActiveStorage but am abandoning that because AS just dumps all your files into the root of your filestore. So down the road when I have a million uploads I have a mess. Carrierwave (and other gems) let you organize your uploads into organized directories etc.

I am currently just using a nested form and ActiveStorage in my edit view. It works but is clunky. I wanted to use Dropzone (as I used a few years back) but it doesn't seem to support nested attributes.

Is there a modern and easy to use combination of gems / JS to do this based on my set-up?

Thanks,

Dan

I don't have an answer for you, but I wonder why is it a problem that all the files are in a single folder. You database will pick the right file for you anyway. You're using a file server for your files, right? So the uploaded files are not mixed up with your Ruby files. Do you ever have to ftp into your file server to find a specific file?

Two reasons - if you have a wreck you cant easily find ophaned files.

I also have clients than need data segrigation.

Dan

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,629+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.