From 8dd76a7a6ff1bb7105beabb8f834ca54ab1e5fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 13 Nov 2017 15:23:28 -0500 Subject: Use .tt extension to all the template files Make clear that the files are not to be run for interpreters. Fixes #23847. Fixes #30690. Closes #23878. --- .../generators/channel/templates/assets/channel.coffee.tt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 actioncable/lib/rails/generators/channel/templates/assets/channel.coffee.tt (limited to 'actioncable/lib/rails/generators/channel/templates/assets/channel.coffee.tt') diff --git a/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee.tt b/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee.tt new file mode 100644 index 0000000000..5467811aba --- /dev/null +++ b/actioncable/lib/rails/generators/channel/templates/assets/channel.coffee.tt @@ -0,0 +1,14 @@ +App.<%= class_name.underscore %> = App.cable.subscriptions.create "<%= class_name %>Channel", + connected: -> + # Called when the subscription is ready for use on the server + + 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 %>' +<% end -%> -- cgit v1.2.3