Ask A Question

Notifications

You’re not receiving notifications from this thread.

How can i upload images directly from controller using Activestorage in Rails 5.2?

JDavid17 asked in General

Hello guys. For learning purposes i am developing a MangaReader using Rails. Now i would like to be able to upload multiple chapters at once, so from a given route say "Downloads/chapters", and with the guarantee that the chapters will be named in a specific format.
I would like to run a method that for each folder in that route creates a chapter and upload all the images it contains. Now i now how to create the chapter and get the name and chapter number... from the file name, but using ActiveStorage i don't now how to manually upload all the images.

Any thoughts?

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.