All threads / How to display Active Storage attached file when editing form?
Ask A Question

Notifications

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 61,257+ 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.

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

    © 2022 GoRails, LLC. All rights reserved.