aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2019-01-16 17:09:53 -0500
committerGitHub <noreply@github.com>2019-01-16 17:09:53 -0500
commita5fee7d531c06176ecc8815f52d9d54050c274ce (patch)
tree11631db8b66c8d7d272dda11c715aeb253eb2ecc /guides
parent90536ebfb3f0ca6971bc3ea4e43f20b8e977539b (diff)
parent385d31d209a957946378307e50aa739ccfadfea1 (diff)
downloadrails-a5fee7d531c06176ecc8815f52d9d54050c274ce.tar.gz
rails-a5fee7d531c06176ecc8815f52d9d54050c274ce.tar.bz2
rails-a5fee7d531c06176ecc8815f52d9d54050c274ce.zip
Merge pull request #34949 from javan/js/compact-start
Minimize boilerplate setup code for JavaScript libraries
Diffstat (limited to 'guides')
-rw-r--r--guides/source/action_cable_overview.md4
-rw-r--r--guides/source/active_storage_overview.md3
2 files changed, 3 insertions, 4 deletions
diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md
index df02d5bd91..8f5c44849a 100644
--- a/guides/source/action_cable_overview.md
+++ b/guides/source/action_cable_overview.md
@@ -181,9 +181,9 @@ established using the following JavaScript, which is generated by default by Rai
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
-import ActionCable from "@rails/actioncable"
+import { createConsumer } from "@rails/actioncable"
-export default ActionCable.createConsumer()
+export default createConsumer()
```
This will ready a consumer that'll connect against `/cable` on your server by default.
diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md
index 6d07d34dd7..474a93c83e 100644
--- a/guides/source/active_storage_overview.md
+++ b/guides/source/active_storage_overview.md
@@ -489,8 +489,7 @@ directly from the client to the cloud.
Using the npm package:
```js
- import * as ActiveStorage from "@rails/activestorage"
- ActiveStorage.start()
+ require("@rails/activestorage").start()
```
2. Annotate file inputs with the direct upload URL.