Class: ActivityLogChannel

Inherits:
ApplicationCable::Channel
  • Object
show all
Defined in:
app/channels/activity_log_channel.rb

Instance Method Summary collapse

Instance Method Details

#receive(data) ⇒ Object



12
13
14
15
# File 'app/channels/activity_log_channel.rb', line 12

def receive(data)
  puts data["message"]
  ActionCable.server.broadcast("messages", "ActionCable is connected")
end

#subscribedObject



2
3
4
# File 'app/channels/activity_log_channel.rb', line 2

def subscribed
  stream_from "messages"
end

#unsubscribedObject



6
7
8
# File 'app/channels/activity_log_channel.rb', line 6

def unsubscribed
  # Any cleanup needed when channel is unsubscribed
end