Refactor: use APP_HOST env variable in development env
It prevents exceptions when APP_HOST is custom in development env. *** ArgumentError Exception: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
This commit is contained in:
parent
2be40cf432
commit
0758e2d1cf
1 changed files with 6 additions and 7 deletions
|
@ -77,15 +77,12 @@ Rails.application.configure do
|
|||
# Action Mailer settings
|
||||
config.action_mailer.delivery_method = :letter_opener
|
||||
|
||||
config.action_mailer.default_url_options = {
|
||||
host: 'localhost',
|
||||
port: 3000
|
||||
}
|
||||
config.action_mailer.asset_host = "http://" + ENV['APP_HOST']
|
||||
config.action_mailer.default_url_options = { host: ENV.fetch("APP_HOST") }
|
||||
config.action_mailer.asset_host = "http://" + ENV.fetch("APP_HOST")
|
||||
|
||||
Rails.application.routes.default_url_options = {
|
||||
host: 'localhost',
|
||||
port: 3000
|
||||
host: ENV.fetch("APP_HOST"),
|
||||
protocol: :http
|
||||
}
|
||||
|
||||
# Use Content-Security-Policy-Report-Only headers
|
||||
|
@ -111,4 +108,6 @@ Rails.application.configure do
|
|||
if ENV['IGN_CARTE_REFERER']
|
||||
config.hosts << ENV['IGN_CARTE_REFERER']
|
||||
end
|
||||
|
||||
config.hosts << ENV.fetch("APP_HOST")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue