All threads / Active-storage creating/uploading folder

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Active-storage creating/uploading folder

Aaron Xavier asked in Ruby

Have any of you guys worked on a project where you can upload or create folders inside your active-storage attachment model? In another words or better way of describing, imagine you have a model called “Projects” which has_many_attachments called Projectfiles. But instead of uploading not just files, you would your users to upload/create folders. A mini dropbox for your project.

Are there any gems or does active-storage allow you to add folders?

I would say, don't think of it as folders on S3 or the file server. Use database records to group and organize them in your app. They don't have to exactly mirror the files on disk.

Got it. Two joint tables to files model and folders model, would do it. That makes sense. Thanks!!

Join the discussion

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

Join 38,558+ 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.