Reputation: 140
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.
Upvotes: 7
Views: 2391
Reputation: 140
That method isn't released until rails 6 next year.
There’s a similar SO question here with more info and a recommendation.
Upvotes: 5