class ChatChannel
Public Instance Methods
send_message(data)
click to toggle source
# File lib/templates/chat/chat_channel.rb, line 9 def send_message(data) content = data['message'] chat_id = data['chat_id'] chat = Chat.find(chat_id) ChatService.create_message(chat, content, current_user) end
subscribed()
click to toggle source
# File lib/templates/chat/chat_channel.rb, line 2 def subscribed chat = Chat.find(params[:chat_id]) stream_for(chat) end
unsubscribed()
click to toggle source
# File lib/templates/chat/chat_channel.rb, line 7 def unsubscribed; end