diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2015-12-17 21:53:05 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2015-12-17 21:53:05 +0100 |
commit | e16d7c68084e49ace46397eb2a84553dad2ecee5 (patch) | |
tree | 8d3b582f9af4ca17408505b81541cab416840d00 /actioncable | |
parent | 19e7f65dd1857511cbfe358e24bd20d3965e7c5b (diff) | |
download | rails-e16d7c68084e49ace46397eb2a84553dad2ecee5.tar.gz rails-e16d7c68084e49ace46397eb2a84553dad2ecee5.tar.bz2 rails-e16d7c68084e49ace46397eb2a84553dad2ecee5.zip |
Should also stub the received callback
Diffstat (limited to 'actioncable')
-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 %>' |