diff options
author | Jon Moss <me@jonathanmoss.me> | 2016-02-24 18:36:55 -0500 |
---|---|---|
committer | Jon Moss <me@jonathanmoss.me> | 2016-02-24 20:37:52 -0500 |
commit | 1afd414488fe73c927242e072af0ff9ab21d2599 (patch) | |
tree | 479623e7c7eeccd1911b69b9fde1077ada24311f /railties | |
parent | 8b69f1eeba753c38364fb88136b2503480f2de1d (diff) | |
download | rails-1afd414488fe73c927242e072af0ff9ab21d2599.tar.gz rails-1afd414488fe73c927242e072af0ff9ab21d2599.tar.bz2 rails-1afd414488fe73c927242e072af0ff9ab21d2599.zip |
Only open Action Cable connection if data is being sent
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee index 07934d026f..af08f58e34 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee +++ b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee @@ -1,11 +1,9 @@ # 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. # -# Turn on the cable connection by removing the comments after the require statements (and ensure it's also on in config/routes.rb). -# #= require action_cable #= require_self #= require_tree ./channels -# -# @App ||= {} -# App.cable = ActionCable.createConsumer() + +@App ||= {} +App.cable = ActionCable.createConsumer() |