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?

Reply

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.

Reply

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

Reply

How can we solve it using files model?
please give me example

Reply

Thank

Reply
Join the discussion
Create an account Log in

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

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

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