In the action cable we can serve data realtime to the listeners of the websocket.
Just take an example :  channel name “web_notifier_channel”
[code language=”ruby”]
$ rails console
Running via Spring preloader in process 19706
Loading development environment (Rails 5.1.0.rc1)
>> ActionCable.server.broadcast ‘web_notifier_channel’,
message: ‘<p>Hello World!</p>’
[/code]
the above command will be send “hello world ” via “web_notifier_channel” so in the client end we need to configure a channel listeners as mentioned below.
[code language=”javascript”]
App.room = App.cable.subscriptions.create "WebNotifierChannel",
received: (data) ->
$(‘#messages’).append data[‘message’]
[/code]
Hope it is very much clear!!!