Skip to content

Instantly share code, notes, and snippets.

@anka
Created August 19, 2017 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anka/f96ee16eb1681afd445223c02fafd68e to your computer and use it in GitHub Desktop.
Save anka/f96ee16eb1681afd445223c02fafd68e to your computer and use it in GitHub Desktop.
Subscribe to the notification channel via action cable
App.quote_generation = App.cable.subscriptions.create channel: "NotificationChannel", param1: value1,
connected: ->
# Called when the subscription is ready for use on the server
disconnected: ->
# Called when the subscription has been terminated by the server
received: (data) ->
# Called when there's incoming data on the websocket for this channel
# Add your code here to e.g. update some UI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment