I have created an ActionCable channel using rails generate channel conversation speak
, then added something like the below code at the end of conversation.coffe:
$ ->
$("button").click (event) ->
alert()
App.conversation.speak("main", event.target.value)
This works as intended and creates a new comment, along with a button that will spawn new comments. The appended button does not fire the above code though. I am using a comment partial and it works only on refreshing the page.