The objective is to download an attached file to tempdir for subsequent usage. The documentation says to use ActiveStorage::Blob#open
which seems simple enough.
I'm getting errors so please explain what I'm doing wrong:
@flower.photo.open
results in NoMethodError (private method 'open' called for #<ActiveStorage::Attached::One:0x00007f9780625100>)
NoMethodError (private method 'open' called for #<ActiveStorage::Blob:0x00007f9780615c50>)
Examining the source code I'm not sure why I'm getting the private method error.
That method isn't released until rails 6 next year.
There’s a similar SO question here with more info and a recommendation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With