diff options
author | David Gay <david@davidgay.org> | 2021-04-21 20:59:17 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-04-21 20:59:17 -0400 |
commit | 975ab9e285baf4f1b22b60104db4f8f982c1db8b (patch) | |
tree | 7ad97e350a11d61f0b356e81fa759baf648dcd1c /app/javascript/channels |
New Rails project with pgsql
Diffstat (limited to 'app/javascript/channels')
-rw-r--r-- | app/javascript/channels/consumer.js | 6 | ||||
-rw-r--r-- | app/javascript/channels/index.js | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/app/javascript/channels/consumer.js b/app/javascript/channels/consumer.js new file mode 100644 index 0000000..8ec3aad --- /dev/null +++ b/app/javascript/channels/consumer.js @@ -0,0 +1,6 @@ +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command. + +import { createConsumer } from "@rails/actioncable" + +export default createConsumer() diff --git a/app/javascript/channels/index.js b/app/javascript/channels/index.js new file mode 100644 index 0000000..0cfcf74 --- /dev/null +++ b/app/javascript/channels/index.js @@ -0,0 +1,5 @@ +// Load all the channels within this directory and all subdirectories. +// Channel files must be named *_channel.js. + +const channels = require.context('.', true, /_channel\.js$/) +channels.keys().forEach(channels) |