diff options
author | Lachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au> | 2015-07-09 17:50:50 +1000 |
---|---|---|
committer | Lachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au> | 2015-07-09 17:50:50 +1000 |
commit | 496bb3883c5e09c06efd2c76246f15cba5d8baf1 (patch) | |
tree | 3cce65051f4aafa98d3781a33f9bd8286a4d52a1 /README.md | |
parent | 2253ebd3cef76db40acd32a414bf423f0a43a443 (diff) | |
download | rails-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.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |