From e16d7c68084e49ace46397eb2a84553dad2ecee5 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 17 Dec 2015 21:53:05 +0100 Subject: Should also stub the received callback --- .../lib/rails/generators/channel/templates/assets/channel.coffee | 3 +++ 1 file changed, 3 insertions(+) (limited to 'actioncable') diff --git a/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee b/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee index 69f945ca3f..149821f1ea 100644 --- a/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee +++ b/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee @@ -5,6 +5,9 @@ App.<%= class_name.underscore %> = App.cable.subscriptions.create "<%= class_nam 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 + <% actions.each do |action| -%> <%= action %>: -> @perform '<%= action %>' -- cgit v1.2.3