aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable
diff options
context:
space:
mode:
authorhenning mueller <mail@nning.io>2015-12-21 09:44:02 +0100
committerhenning mueller <mail@nning.io>2015-12-21 09:44:02 +0100
commitcb6f337aac024e65def1297732f99d25980098f6 (patch)
treeb306bcfa3c831855a8977a0ed26245454b67c51b /actioncable
parent16bee0f5bde72bf1e1833fddf36f8bdd2fc29390 (diff)
downloadrails-cb6f337aac024e65def1297732f99d25980098f6.tar.gz
rails-cb6f337aac024e65def1297732f99d25980098f6.tar.bz2
rails-cb6f337aac024e65def1297732f99d25980098f6.zip
Use default cable path in (in-app) server config example.
Diffstat (limited to 'actioncable')
-rw-r--r--actioncable/README.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/actioncable/README.md b/actioncable/README.md
index a73e05cffa..26de8c5b05 100644
--- a/actioncable/README.md
+++ b/actioncable/README.md
@@ -399,16 +399,16 @@ The above will start a cable server on port 28080. Remember to point your client
### In app
-If you are using a threaded server like Puma or Thin, the current implementation of ActionCable can run side-along with your Rails application. For example, to listen for WebSocket requests on `/websocket`, match requests on that path:
+If you are using a threaded server like Puma or Thin, the current implementation of ActionCable can run side-along with your Rails application. For example, to listen for WebSocket requests on `/cable`, match requests on that path:
```ruby
# config/routes.rb
Example::Application.routes.draw do
- match "/websocket", :to => ActionCable.server, via: [:get, :post]
+ match "/cable", :to => ActionCable.server, via: [:get, :post]
end
```
-You can use `App.cable = ActionCable.createConsumer("/websocket")` to connect to the cable server.
+You can use `App.cable = ActionCable.createConsumer()` to connect to the cable server if `action_cable_meta_tag` is included in the layout. A custom path is specified as first argument to `createConsumer` (e.g. `App.cable = ActionCable.createConsumer("/websocket")`).
For every instance of your server you create and for every worker your server spawns, you will also have a new instance of ActionCable, but the use of Redis keeps messages synced across connections.