Class: ChatChannel
- Inherits:
-
ApplicationCable::Channel
- Object
- ApplicationCable::Channel
- ChatChannel
- Defined in:
- app/channels/chat_channel.rb
Instance Method Summary collapse
Instance Method Details
#received(data) ⇒ Object
8 9 |
# File 'app/channels/chat_channel.rb', line 8 def received(data) end |
#subscribed ⇒ Object
2 3 4 5 6 |
# File 'app/channels/chat_channel.rb', line 2 def subscribed user = params[:user] stream_from "ChatChannel" ActionCable.server.broadcast("chat_channel", { message: "Hello, world!", user: user }) end |
#unsubscribed ⇒ Object
11 12 |
# File 'app/channels/chat_channel.rb', line 11 def unsubscribed end |