mirror of
https://github.com/beatriceo/polyglot.git
synced 2025-10-25 02:42:10 +00:00
added chatroom channel with room ids and notifications channel
This commit is contained in:
9
app/channels/chat_rooms_channel.rb
Normal file
9
app/channels/chat_rooms_channel.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class ChatRoomsChannel < ApplicationCable::Channel
|
||||
def subscribed
|
||||
stream_from "chat_room_#{params[:room]}"
|
||||
end
|
||||
|
||||
def unsubscribed
|
||||
# Any cleanup needed when channel is unsubscribed
|
||||
end
|
||||
end
|
||||
9
app/channels/notifications_channel.rb
Normal file
9
app/channels/notifications_channel.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class NotificationsChannel < ApplicationCable::Channel
|
||||
def subscribed
|
||||
stream_from "notifications"
|
||||
end
|
||||
|
||||
def unsubscribed
|
||||
# Any cleanup needed when channel is unsubscribed
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user