Skip to content

Commit 5821bae

Browse files
authored
Merge pull request rails#26125 from qinix/fix-doc
[ci skip] Fix the wrong ActionCable documentation in the guide.
2 parents 134e431 + 3f9d380 commit 5821bae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

guides/source/action_cable_overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ WebNotificationsChannel.broadcast_to(
242242
The `WebNotificationsChannel.broadcast_to` call places a message in the current
243243
subscription adapter (Redis by default)'s pubsub queue under a separate
244244
broadcasting name for each user. For a user with an ID of 1, the broadcasting
245-
name would be `web_notifications_1`.
245+
name would be `web_notifications:1`.
246246

247247
The channel has been instructed to stream everything that arrives at
248-
`web_notifications_1` directly to the client by invoking the `received`
248+
`web_notifications:1` directly to the client by invoking the `received`
249249
callback.
250250

251251
### Subscriptions
@@ -313,7 +313,7 @@ App.cable.subscriptions.create { channel: "ChatChannel", room: "Best Room" },
313313
```ruby
314314
# Somewhere in your app this is called, perhaps
315315
# from a NewCommentJob.
316-
ChatChannel.broadcast_to(
316+
ActionCable.server.broadcast(
317317
"chat_#{room}",
318318
sent_by: 'Paul',
319319
body: 'This is a cool chat app.'

0 commit comments

Comments
 (0)