aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorLachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au>2015-07-09 17:50:50 +1000
committerLachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au>2015-07-09 17:50:50 +1000
commit496bb3883c5e09c06efd2c76246f15cba5d8baf1 (patch)
tree3cce65051f4aafa98d3781a33f9bd8286a4d52a1 /README.md
parent2253ebd3cef76db40acd32a414bf423f0a43a443 (diff)
downloadrails-496bb3883c5e09c06efd2c76246f15cba5d8baf1.tar.gz
rails-496bb3883c5e09c06efd2c76246f15cba5d8baf1.tar.bz2
rails-496bb3883c5e09c06efd2c76246f15cba5d8baf1.zip
update README to include creating the ApplicationCabel::Channel
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index efa3b52dc0..f16dfe7377 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,18 @@ module ApplicationCable
end
```
+Then you should define your `ApplicationCable::Channel` class in Ruby. This is the place where you put
+shared logic between your channels.
+
+```ruby
+# app/channels/application_cable/channel.rb
+```ruby
+module ApplicationCable
+ class Channel < ActionCable::Channel::Base
+ end
+end
+```
+
This relies on the fact that you will already have handled authentication of the user, and
that a successful authentication sets a signed cookie with the `user_id`. This cookie is then
automatically sent to the connection instance when a new connection is attempted, and you