diff options
Diffstat (limited to 'actioncable/lib/rails/generators/channel/templates/assets')
-rw-r--r-- | actioncable/lib/rails/generators/channel/templates/assets/channel.coffee | 3 |
1 files changed, 3 insertions, 0 deletions
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 %>' |