shrinerb / shrine

File Attachment toolkit for Ruby applications

Home Page:https://shrinerb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation for `image_url` options

childish-sambino opened this issue · comments

I struggled to figure out how to generate a pre-signed URL for downloading files from cloud providers. Looks like the S3 and GCloud storage providers allows this by passing an expires arg. E.g., photo.image_url(expires: 10.minutes.to_i)

Requesting documentation be added here to note this support.

it is documented for S3 here: https://shrinerb.com/docs/storage/s3#url-options

With a specific mention of expires, and a link to AWS SDK api docs for a list of all options supported, which the docs say are forwarded there.

These options are provider-specific, as you say.

There is a lot in shrine, so it's hard to figure out where to put everything to make it visible.

Can you say where you were looking for this documentation and not seeing it?

Perhaps you are interested in making a PR request? Although again with so much documentation, putting a lot of words on something somewhere runs the risk of pushing visibility of something else out of the way, there is an art to trying to keep things succinct while still being complete.

As @jrochkind said, this is technically documented. If you would like to improve the docs to better connect Storage#url to the <attachment>_url model method, PRs are welcome.