1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Add public_file_server setting for Rails5

This commit is contained in:
Shinya Kitamura 2016-06-01 14:44:35 +08:00
parent bcdd54cc5e
commit 57980ba82a
2 changed files with 8 additions and 7 deletions

View file

@ -20,7 +20,9 @@ RailsApp::Application.configure do
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
if Rails.version >= "4.2.0"
if Rails.version >= "5.0.0"
config.public_file_server.enabled = false
elsif Rails.version >= "4.2.0"
config.serve_static_files = false
else
config.serve_static_assets = false

View file

@ -14,15 +14,14 @@ RailsApp::Application.configure do
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
if Rails.version >= "4.2.0"
if Rails.version >= "5.0.0"
config.public_file_server.enabled = true
config.public_file_server.headers = {'Cache-Control' => 'public, max-age=3600'}
elsif Rails.version >= "4.2.0"
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
else
config.serve_static_assets = true
end
if Rails.version >= "5.0.0"
config.public_file_server.headers = {'Cache-Control' => 'public, max-age=3600'}
else
config.static_cache_control = "public, max-age=3600"
end