mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fix typo in file path [ci skip]
This commit is contained in:
parent
87c2c070c4
commit
f02a94037d
1 changed files with 4 additions and 4 deletions
|
@ -106,11 +106,11 @@ Then you would create your own channel classes. For example, you could have a
|
|||
**ChatChannel** and an **AppearanceChannel**:
|
||||
|
||||
```ruby
|
||||
# app/channels/application_cable/chat_channel.rb
|
||||
# app/channels/chat_channel.rb
|
||||
class ChatChannel < ApplicationCable::Channel
|
||||
end
|
||||
|
||||
# app/channels/application_cable/appearance_channel.rb
|
||||
# app/channels/appearance_channel.rb
|
||||
class AppearanceChannel < ApplicationCable::Channel
|
||||
end
|
||||
```
|
||||
|
@ -125,7 +125,7 @@ Incoming messages are then routed to these channel subscriptions based on
|
|||
an identifier sent by the cable consumer.
|
||||
|
||||
```ruby
|
||||
# app/channels/application_cable/chat_channel.rb
|
||||
# app/channels/chat_channel.rb
|
||||
class ChatChannel < ApplicationCable::Channel
|
||||
# Called when the consumer has successfully become a subscriber of this channel
|
||||
def subscribed
|
||||
|
@ -182,7 +182,7 @@ Streams provide the mechanism by which channels route published content
|
|||
(broadcasts) to its subscribers.
|
||||
|
||||
```ruby
|
||||
# app/channels/application_cable/chat_channel.rb
|
||||
# app/channels/chat_channel.rb
|
||||
class ChatChannel < ApplicationCable::Channel
|
||||
def subscribed
|
||||
stream_from "chat_#{params[:room]}"
|
||||
|
|
Loading…
Reference in a new issue