aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/README.md
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-05-07 12:12:27 +0900
committerKasper Timm Hansen <kaspth@gmail.com>2016-05-07 21:15:33 +0200
commit017c7f46e0aadffd2e5f02efb5918c0439716a7e (patch)
treec0a1eef3630b32188ad19e03eb708ba3bb4f27f6 /actioncable/README.md
parent692715eb7aa5312398d2552881e872216147b63f (diff)
downloadrails-017c7f46e0aadffd2e5f02efb5918c0439716a7e.tar.gz
rails-017c7f46e0aadffd2e5f02efb5918c0439716a7e.tar.bz2
rails-017c7f46e0aadffd2e5f02efb5918c0439716a7e.zip
change cable.coffee to cable.js [ci skip]
In #23935, cable file was to be provided by the javascript instead of coffeescript, doc was also been modified to use javascript.
Diffstat (limited to 'actioncable/README.md')
-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