shrinerb / shrine

File Attachment toolkit for Ruby applications
https://shrinerb.com
MIT License
3.18k stars 275 forks source link

Documentation for `image_url` options #666

Closed childish-sambino closed 10 months ago

childish-sambino commented 10 months ago

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.

jrochkind commented 10 months ago

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.

janko commented 10 months ago

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.