Configure action_controller.default_url_options

so that using url helpers will work in turbo stream notifications sent
by background jobs.

ref: https://fizzy.37signals.com/5986089/collections/2/cards/1469
This commit is contained in:
Mike Dalessio
2025-09-01 11:19:26 -04:00
parent 168a44a368
commit bf04f4f12d
4 changed files with 10 additions and 9 deletions
+3 -5
View File
@@ -39,9 +39,6 @@ Rails.application.configure do
config.action_mailer.perform_caching = false
# Set host to be used by links generated in mailer templates.
config.action_mailer.default_url_options = { host: "%{tenant}.example.com", port: 3006 }
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
@@ -81,8 +78,9 @@ Rails.application.configure do
config.hosts = %w[ fizzy.localhost localhost 127.0.0.1 ]
# Host to be used in links rendered from ActionMailer
config.action_mailer.default_url_options = { host: config.hosts.first, port: 3006 }
# Set host to be used by links generated in mailer and notification view templates.
config.action_controller.default_url_options = { host: config.hosts.first, port: 3006 }
config.action_mailer.default_url_options = { host: config.hosts.first, port: 3006 }
if Rails.root.join("tmp/solid-queue.txt").exist?
config.active_job.queue_adapter = :solid_queue