Skip to content

Commit 5ad1dd3

Browse files
authored
Merge pull request #4552 from alphagov/asset-host
Switch asset path and host
2 parents 3e15641 + 83848dd commit 5ad1dd3

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

config/application.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ class Application < Rails::Application
4444
config.filter_parameters += [:password]
4545

4646
# Path within public/ where assets are compiled to
47-
config.assets.prefix = "/smartanswers"
47+
config.assets.prefix = "/assets/smartanswers"
48+
49+
# allow overriding the asset host with an enironment variable, useful for
50+
# when router is proxying to this app but asset proxying isn't set up.
51+
config.asset_host = ENV["ASSET_HOST"]
4852

4953
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
5054
config.assets.precompile += %w[

config/environments/development.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
# number of complex assets.
3737
config.assets.debug = true
3838

39-
if ENV["GOVUK_ASSET_ROOT"].present?
40-
config.asset_host = ENV["GOVUK_ASSET_ROOT"]
41-
end
42-
4339
# Suppress logger output for asset requests.
4440
config.assets.quiet = true
4541

config/environments/production.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
# Do not fallback to assets pipeline if a precompiled asset is missed.
3131
config.assets.compile = false
3232

33-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
34-
# config.action_controller.asset_host = "http://assets.example.com"
35-
3633
# Specifies the header that your server uses for sending files.
3734
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
3835
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
@@ -61,8 +58,6 @@
6158
# Send deprecation notices to registered listeners.
6259
config.active_support.deprecation = :notify
6360

64-
config.action_controller.asset_host = ENV["GOVUK_ASSET_HOST"]
65-
6661
if ENV["RUNNING_ON_HEROKU"]
6762
# flush output to the underlying OS without buffering
6863
STDOUT.sync = true

config/initializers/slimmer.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
SmartAnswers::Application.configure do
22
config.slimmer.logger = Rails.logger
3-
4-
if Rails.env.development?
5-
config.slimmer.asset_host = ENV["STATIC_DEV"] || Plek.new.find("static")
6-
end
73
end

0 commit comments

Comments
 (0)