aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable')
-rw-r--r--actioncable/README.md15
1 files changed, 10 insertions, 5 deletions
diff --git a/actioncable/README.md b/actioncable/README.md
index 1d9864292f..8792113664 100644
--- a/actioncable/README.md
+++ b/actioncable/README.md
@@ -86,12 +86,17 @@ end
The client-side needs to setup a consumer instance of this connection. That's done like so:
-```coffeescript
-# app/assets/javascripts/cable.coffee
-#= require action_cable
+```js
+// app/assets/javascripts/cable.js
+//= require action_cable
+//= require_self
+//= require_tree ./channels
+
+(function() {
+ this.App || (this.App = {});
-@App = {}
-App.cable = ActionCable.createConsumer("ws://cable.example.com")
+ App.cable = ActionCable.createConsumer("ws://cable.example.com");
+}).call(this);
```
The `ws://cable.example.com` address must point to your Action Cable server(s), and it