Ask A Question


You’re not receiving notifications from this thread.

How to display Active Storage attached file when editing form?

danielindon asked in General

I am building an Agreement management app. Each Agreement has vendor, activation, expiration dates and file. File is an attached agreement in pdf. I use Active Storage for attaching files. When I edit the form I don't see the attached file. As a consequence if I change any other parameter let's say vendor and update Agreement the previously attached file is being deleted.

What should I do to get the attached file name to be present on update and not being removed if I don't upload any other file while editing?

Join the discussion

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

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

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

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.