jeudi 9 mai 2019

How to pass/hide signed_id to Rails API controller when updating a model

I'm using Rails 5.2 API with Ember JS ember-active-storage add-on and would like to know how it is possible to update a model with an existing attached image without attaching a new one? It seems like Rails ActiveStorage needs to get the blob signed_id in a hidden input field to be able to process the request correctly in case of direct uploads. For example, if I try to update the model that has a photo, photo attribute being the photo URL, Rails will raise the error:

ActiveSupport::MessageVerifier::InvalidSignature (ActiveSupport::MessageVerifier::InvalidSignature)

as there is no siged_id provided in the request params.

Any ideas? Or am I missing something? Thank you.




Aucun commentaire:

Enregistrer un commentaire