Point Action Cable at the slugged cable endpoint

I proposed this upstream in https://github.com/rails/rails/pull/55250,
but it's not clear if the presence of script_name should _always_
prefix generated URLs, so for now it's local to Fizzy.
This commit is contained in:
Mike Dalessio
2025-06-26 15:04:03 -04:00
parent e378c5a45e
commit 98e6bd8cd7
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
module TenantingHelper
def tenanted_action_cable_meta_tag
tag "meta",
name: "action-cable-url",
content: [ request.script_name, ActionCable.server.config.mount_path ].join("/")
end
end
+1
View File
@@ -15,6 +15,7 @@
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>
<%= tenanted_action_cable_meta_tag %>
<%= yield :head %>
<link rel="manifest" href="/manifest.json">