diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action_cable/connection/base.rb | 2 | ||||
-rw-r--r-- | lib/assets/javascripts/cable.js.coffee | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb index fff6fd46a6..5c2ee14258 100644 --- a/lib/action_cable/connection/base.rb +++ b/lib/action_cable/connection/base.rb @@ -69,7 +69,7 @@ module ActionCable data = ActiveSupport::JSON.decode data - case data['action'] + case data['command'] when 'subscribe' subscribe_channel(data) when 'unsubscribe' diff --git a/lib/assets/javascripts/cable.js.coffee b/lib/assets/javascripts/cable.js.coffee index 345771dd1f..7c033d3b08 100644 --- a/lib/assets/javascripts/cable.js.coffee +++ b/lib/assets/javascripts/cable.js.coffee @@ -28,7 +28,7 @@ class @Cable sendData: (identifier, data) => if @isConnected() - @connection.send JSON.stringify { action: 'message', identifier: identifier, data: data } + @connection.send JSON.stringify { command: 'message', identifier: identifier, data: data } receiveData: (message) => data = JSON.parse message.data @@ -109,11 +109,11 @@ class @Cable subscribeOnServer: (identifier) => if @isConnected() - @connection.send JSON.stringify { action: 'subscribe', identifier: identifier } + @connection.send JSON.stringify { command: 'subscribe', identifier: identifier } unsubscribeOnServer: (identifier) => if @isConnected() - @connection.send JSON.stringify { action: 'unsubscribe', identifier: identifier } + @connection.send JSON.stringify { command: 'unsubscribe', identifier: identifier } pingReceived: (timestamp) => if @lastPingTime? and (timestamp - @lastPingTime) > @PING_STALE_INTERVAL |