diff options
author | Chris Bisnett <cbisnett@gmail.com> | 2018-09-14 10:23:32 -0400 |
---|---|---|
committer | Chris Bisnett <cbisnett@gmail.com> | 2018-09-14 10:40:18 -0400 |
commit | 7dd9916c0d5e5d149bdde8cbeec42ca49cf3f6ca (patch) | |
tree | 75a4fd691ac8d1cdb1d67a1cd469c26bb837c4e6 /guides | |
parent | d3c73ae5e4ebabdf6c79e490fddb2cbfb0de3b76 (diff) | |
download | rails-7dd9916c0d5e5d149bdde8cbeec42ca49cf3f6ca.tar.gz rails-7dd9916c0d5e5d149bdde8cbeec42ca49cf3f6ca.tar.bz2 rails-7dd9916c0d5e5d149bdde8cbeec42ca49cf3f6ca.zip |
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`.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/configuring.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 0ff6f48c14..e372b3a816 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -832,6 +832,14 @@ text/javascript image/svg+xml application/postscript application/x-shockwave-fla The default is 5 minutes. +* `config.active_storage.routes_prefix` can be used to set the route prefix for the routes served by Active Storage. Accepts a string that will be prepended to the generated routes. + + ```ruby + config.active_storage.routes_prefix = '/files' + ``` + + The default is `/rails/active_storage` + ### Configuring a Database Just about every Rails application will interact with a database. You can connect to the database by setting an environment variable `ENV['DATABASE_URL']` or by using a configuration file called `config/database.yml`. |