added chatroom channel with room ids and notifications channel

This commit is contained in:
Beatrice Olivera
2018-08-30 03:00:09 +01:00
parent f0bca74f89
commit 405d2cd5df
17 changed files with 699 additions and 25 deletions

View 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

View 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