mirror of
https://github.com/beatriceo/polyglot.git
synced 2025-10-26 03:02:12 +00:00
added message sending
This commit is contained in:
@@ -19,17 +19,18 @@ App['chatroom' + chatroomId] = App.cable.subscriptions.create({
|
||||
connected: () => {
|
||||
},
|
||||
received: data => {
|
||||
console.log(data)
|
||||
}
|
||||
})
|
||||
|
||||
// Testing ActionCable
|
||||
// const testBtn = document.getElementById('test-btn')
|
||||
// testBtn.addEventListener('click', event => {
|
||||
// fetch(`/chat_rooms/${chatroomId}/cable_testing` , {
|
||||
// method: 'POST',
|
||||
// body: JSON.stringify({})
|
||||
// })
|
||||
// })
|
||||
const testBtn = document.getElementById('test-btn')
|
||||
testBtn.addEventListener('click', event => {
|
||||
fetch(`/chat_rooms/${chatroomId}/cable_testing` , {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user