Sha256: 017a382f46ed4d250eb0155ae66adc09f1229f28a004a3ef6493d38c12d15ec5

Contents?: true

Size: 246 Bytes

Versions: 2

Compression:

Stored size: 246 Bytes

Contents

class RoomsTextingChannel < ApplicationCable::Channel
  def send_message(data)
    chat = Chat.new(
      text: data["message"],
      sender: User.first
    )
    chat.save!
  end

  def subscribed
    stream_from "chat_rooms_channel"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veritrans-2.3.0 example/rails/cable/app/channels/rooms_texting_channel.rb
veritrans-2.2.0 example/rails/cable/app/channels/rooms_texting_channel.rb