Class: PolylinguoChatChannel

Inherits:
ApplicationCable::Channel show all
Defined in:
lib/generators/polylingo_chat/install/templates/channels/polylingo_chat_channel.rb

Instance Method Summary collapse

Instance Method Details

#subscribedObject



2
3
4
5
6
7
8
9
10
# File 'lib/generators/polylingo_chat/install/templates/channels/polylingo_chat_channel.rb', line 2

def subscribed
  conversation_id = params[:conversation_id]

  # Subscribe to conversation-level channel for demo
  stream_from "conversation_#{conversation_id}"

  # Also subscribe to user-specific channel for production use
  stream_from "polylingo_chat_recipient_#{current_user.id}"
end

#unsubscribedObject



12
13
14
# File 'lib/generators/polylingo_chat/install/templates/channels/polylingo_chat_channel.rb', line 12

def unsubscribed
  # Cleanup when channel is unsubscribed
end