aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2015-12-17 21:53:05 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2015-12-17 21:53:05 +0100
commite16d7c68084e49ace46397eb2a84553dad2ecee5 (patch)
tree8d3b582f9af4ca17408505b81541cab416840d00 /actioncable
parent19e7f65dd1857511cbfe358e24bd20d3965e7c5b (diff)
downloadrails-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.coffee3
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 %>'