[RAILS] About DelegationError (Active Storage)

Creating a portfolio DelegationError I get an error and the content below it variant delegated to attachment, but attachment is nil (google translate) A variant delegated to an attachment, the attachment is nil I got an error.

Solutions

Since my app is developing an app like Instagram, I hypothesized that this error occurred because there are no photos ** I was able to solve this problem by resetting the database! !! ** **

As a countermeasure

As a countermeasure for this error, I think that I will use it so that this error does not appear by making it impossible to save if the image does not exist in the column to save the photo

Recommended Posts

About DelegationError (Active Storage)
About Active Storage
[Beginner] About Active Storage
Introduce Active Storage
[Rails] About active hash
Active Storage Initialization Manual
gem active_hash About active hash
Post videos with Active Storage
Move Active Storage on S3 locally
[Rails] How to use Active Storage
About =
Unit tests under Active Storage deployment
[Active Storage] Validation settings when uploading files
[Ruby on Rails] About Active Record callbacks
Rails Active Storage shrinks images before uploading
Post / delete multiple images with Active Storage