aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJon Moss <me@jonathanmoss.me>2016-02-24 18:36:55 -0500
committerJon Moss <me@jonathanmoss.me>2016-02-24 20:37:52 -0500
commit1afd414488fe73c927242e072af0ff9ab21d2599 (patch)
tree479623e7c7eeccd1911b69b9fde1077ada24311f /railties
parent8b69f1eeba753c38364fb88136b2503480f2de1d (diff)
downloadrails-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.coffee8
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()