From 7dd9916c0d5e5d149bdde8cbeec42ca49cf3f6ca Mon Sep 17 00:00:00 2001 From: Chris Bisnett Date: Fri, 14 Sep 2018 10:23:32 -0400 Subject: 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`. --- guides/source/configuring.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'guides/source/configuring.md') 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`. -- cgit v1.2.3