Commit Graph

20 Commits

Author SHA1 Message Date
aki
1f9fbbe213
Add expires_at option to ActiveStorage::Blob#signed_id 2023-09-26 21:08:20 +00:00
aki
209a79aeed Add support for ActiveStorage expiring URLs 2021-06-14 20:45:01 +09:00
Ali Ismayilov
a205f5110d
Respect default serving strategy in rails_{blob,representation}_{url,path} 2021-01-28 18:52:00 -05:00
George Claghorn
7e52d0ae58 Preserve old redirect URLs
They may be cached for existing apps upgrading to 6.1. Follows up on #34477.
2020-05-21 10:36:34 -04:00
Jonathan Fleckenstein
dfb5a82b25
Active Storage: allow serving files by proxying 2020-05-11 16:21:58 -04:00
Peter Zhu
fbb83d78c3 Use DiskController for both public and private files 2019-12-06 16:02:16 -05:00
George Claghorn
f7da355409 Add resolved route for ActiveStorage::VariantWithRecord 2019-12-06 14:03:07 -05:00
Peter Zhu
feab7031b5 Permanent URLs for public storage blobs
Services can be configured in `config/storage.yml` with a new key
`public: true | false` to indicate whether a service holds public
blobs or private blobs. Public services will always return a
permanent URL.

Deprecates `Blob#service_url` in favor of `Blob#url`.
2019-10-11 15:14:43 -04:00
Gannon McGibbon
3cf65bcb8e Make Active Storage routes optional
Add configuration option to turn off drawing of Active Storage routes.
2019-07-22 12:35:04 -04:00
Chris Bisnett
7dd9916c0d Configure Active Storage route prefix
Applications can configure the route prefix prepended to the Active
Storage routes. By default this maintains the previous prefix
`/rails/active_storage` but supports custom prefixes.

Before this change the route for serving blobs is fixed to
`/rails/active_storage/blobs/:signed_id/*filename`. After this change
it's possible to configure the route to something like
`/files/blobs/:signed_id/*filename`.
2018-09-14 10:40:18 -04:00
Kasper Timm Hansen
0f302b8970
Merge Previews/Variants controller into one Representations controller.
Since ActiveStorage::Blob::Representable unifies the idea of previews and
variants under one roof as representation, we may as well have the
controllers follow suit.

Thus ActiveStorage::RepresenationsController enters the fray. I've copied
the old tests for both previews and variants and unified those as well.
2018-03-03 21:36:43 +01:00
Yoshiyuki Hirano
835e27289a Pass options to rails_blob_url 2017-12-22 05:28:23 +09:00
Mehmet Emin INAC
ff25c25127
Expose Active Storage routes 2017-12-13 19:28:57 +01:00
George Claghorn
3fa812615a Fix that some ASt route helpers silently discarded options 2017-11-21 14:17:12 -05:00
George Claghorn
d30586211b Preview PDFs and videos 2017-09-28 16:43:37 -04:00
yuuji.yaginuma
3bf95f9513 Don't expose Active Storage routes
These routes are only used internally in Active Storage, and it seems
that there is no need for the user to directly use them.

Therefore, I think that routes should not be exposed to users.
2017-09-16 14:54:51 +09:00
Koichi ITO
d02844f249 Use frozen string literal in Active Storage 2017-08-12 21:43:42 +09:00
claudiob
9d636c9e2f Make Rubocop happier about ActiveStorage
Running `rubocop activestorage` before this commit resulted in 20 offenses.
This commit only fixes:

- Trailing whitespace detected
- Space inside } missing
- Put one space between the method name and the first argument.

The other offenses are left since they are intentional according to
@georgeclaghorn (https://github.com/rails/rails/pull/30061#issuecomment-319999190)
2017-08-03 11:43:08 -07:00
David Heinemeier Hansson
90a8e0698d Use config/storage.yml as part of the skeleton and loading 2017-07-31 15:57:37 -05:00
Rafael Mendonça França
9330d01ada Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'
git-subtree-dir: activestorage
git-subtree-mainline: 0d58e7e478e79c2d6b2a39a4444d2a17a903b2a6
git-subtree-split: 3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58
2017-07-31 15:21:22 -04:00