aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/rails/generators/channel/templates/channel.rb.tt
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/lib/rails/generators/channel/templates/channel.rb.tt')
-rw-r--r--actioncable/lib/rails/generators/channel/templates/channel.rb.tt16
1 files changed, 16 insertions, 0 deletions
diff --git a/actioncable/lib/rails/generators/channel/templates/channel.rb.tt b/actioncable/lib/rails/generators/channel/templates/channel.rb.tt
new file mode 100644
index 0000000000..4bcfb2be4d
--- /dev/null
+++ b/actioncable/lib/rails/generators/channel/templates/channel.rb.tt
@@ -0,0 +1,16 @@
+<% module_namespacing do -%>
+class <%= class_name %>Channel < ApplicationCable::Channel
+ def subscribed
+ # stream_from "some_channel"
+ end
+
+ def unsubscribed
+ # Any cleanup needed when channel is unsubscribed
+ end
+<% actions.each do |action| -%>
+
+ def <%= action %>
+ end
+<% end -%>
+end
+<% end -%>