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

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?

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.