class ChatChannel

Public Instance Methods

receive(data) click to toggle source
# File lib/templates/chat_channel.rb, line 9
def receive(data)
  data["time"] = Time.now.strftime("at %I:%M%p")
  ActionCable.server.broadcast("chat_#{params[:room]}", data)
  RubyBotJob.perform_later data,params[:room]
end
subscribed() click to toggle source

Called when the consumer has successfully become a subscriber of this channel.

# File lib/templates/chat_channel.rb, line 5
def subscribed
  stream_from "chat_#{params[:room]}"
end