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 37,344+ 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.