suspenders icon indicating copy to clipboard operation
suspenders copied to clipboard

Properly setup Active Storage

Open ACPK opened this issue 5 years ago • 2 comments

Line #11 in config/environments/production reads:

  config.active_storage.service = :local

With the Heroku setup, shouldn't there be an ENV variable here so users can set it to a third-party service (ex: AWS)?

ACPK avatar Oct 17 '18 01:10 ACPK

You are right. :local would not work on Heroku.

I think it would be a good idea to use an ENV variable even if the app is not set up on heroku.

# in .env
ACTIVE_STORAGE_SERVICE='local'
# in config/environments/production.rb
config.active_storage.service = ENV.fetch('ACTIVE_STORAGE_SERVICE', :local).to_sym

delphaber avatar Oct 17 '18 18:10 delphaber