diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-04-12 22:49:38 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-04-12 22:49:38 +0530 |
commit | d0023deb74c8093900f0d703bb5c68eb766e5bdd (patch) | |
tree | ac4d9b5457f027774854c66317d53a71fa359fb9 /actioncable/lib/rails/generators/channel/templates | |
parent | db9bc8097399aab9c866175b12e9e099b6c83ffa (diff) | |
download | rails-d0023deb74c8093900f0d703bb5c68eb766e5bdd.tar.gz rails-d0023deb74c8093900f0d703bb5c68eb766e5bdd.tar.bz2 rails-d0023deb74c8093900f0d703bb5c68eb766e5bdd.zip |
Generate `cable.js` file if does not exist when generating channel
- Before this, while generating a channel, we were not creating
`cable.js` if it does not already exist.
- We have similar code for application mailer here -
https://github.com/rails/rails/commit/0b3ae023d27197417541932632055cd6be4810c4.
- Based on the comment -
https://github.com/rails/rails/issues/24418#issuecomment-205421995.
Diffstat (limited to 'actioncable/lib/rails/generators/channel/templates')
-rw-r--r-- | actioncable/lib/rails/generators/channel/templates/assets/cable.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actioncable/lib/rails/generators/channel/templates/assets/cable.js b/actioncable/lib/rails/generators/channel/templates/assets/cable.js new file mode 100644 index 0000000000..71ee1e66de --- /dev/null +++ b/actioncable/lib/rails/generators/channel/templates/assets/cable.js @@ -0,0 +1,13 @@ +// 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. +// +//= require action_cable +//= require_self +//= require_tree ./channels + +(function() { + this.App || (this.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); |