diff --git a/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee b/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee index 149821f1ea..5467811aba 100644 --- a/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee +++ b/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee @@ -7,8 +7,8 @@ App.<%= class_name.underscore %> = App.cable.subscriptions.create "<%= class_nam received: (data) -> # Called when there's incoming data on the websocket for this channel - <% actions.each do |action| -%> + <%= action %>: -> @perform '<%= action %>' <% end -%>