Save 36% for Black Friday! Learn more

New Discussion

Notifications

You’re not receiving notifications from this thread.

How can I get a file object from active storage to attach to a different model?

1
Rails

I'd like to access a file object that already exists in active storage and re-attach it to another model. Something like
@newmodel.image.attach(file_object_already_in_active_storage)

Is this possible?

Variations of rails_blob_path and url_for methods produce invalid signature errors.

Found this link on how to reference a blob for use with another model.

https://github.com/rails/rails/issues/31674

Join the discussion
Create an account Log in