Class: Message

Inherits:
ApplicationRecord
  • Object
show all
Includes:
ActionView::RecordIdentifier
Defined in:
lib/generators/appchat/templates/models/message.rb

Instance Method Summary collapse

Instance Method Details

#broadcast_messageObject



13
14
15
# File 'lib/generators/appchat/templates/models/message.rb', line 13

def broadcast_message
  broadcast_append_to dom_id(chat, :messages), target: "chat-messages", partial: "messages/message", locals: { message: self }
end

#broadcast_update_messageObject



9
10
11
# File 'lib/generators/appchat/templates/models/message.rb', line 9

def broadcast_update_message
  broadcast_replace_to dom_id(chat, :messages), target: dom_id(self), partial: "messages/message", locals: { message: self }
end