Hello Is there someone out there who can explain this error to me. It works on local machine and also when using heroku local but as soon as it's run on heroku production it gives me this error and i have done all the testing and also tried to get some more error data but no luck.
What's in Use: heroku, sidekiq, actioncable, ruby on rails 5.0.1
[ActionCable] [test@mail.com] Could not execute command from {"command"=>"message", "identifier"=>"{\"channel\":\"RoomChannel\"}", "data"=>"\"message:message\""})
[NoMethodError - undefined method `except' >for "message: message":String
2017-02-06T00:48:33.207838+00:00 app[web.1]:
Did you >mean? exec]: /app/vendor/bundle/ruby/2.3.0/gems/actioncable->
5.0.1/lib/action_cable/channel/base.rb:272:in `block in action_signature'
| /app/vendor/bundle/ruby/2.3.0/gems/actioncable- 5.0.1/lib/action_cable/channel/base.rb:271:in `tap'
| /app/vendor/bundle/ruby/2.3.0/gems/actioncable- 5.0.1/lib/action_cable/channel/base.rb:271:in `action_signature'
| /app/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.1/lib/action_cable/channel/base.rb:169:in `perform_action'
| /app/vendor/bundle/ruby/2.3.0/gems/actioncable- 5.0.1/lib/action_cable/connection/subscriptions.rb:53:in `perform_action'
room.coffe
App.room = App.cable.subscriptions.create "RoomChannel",
connected: ->
console.log "live"
# Called when the subscription is ready for use on the server
disconnected: ->
# Called when the subscription has been terminated by the server
received: (data) ->
console.log data
# Called when there's incoming data on the websocket for this channel
$messages = $('#messages')
$messages.append data
$messages.scrollTop $messages.prop('scrollHeight')
speak: (message) ->
console.log message
@perform 'speak', message: message
room_channel.rb
class RoomChannel < ApplicationCable::Channel
def subscribed
stream_from "room_channel"
end
def unsubscribed
# Any cleanup needed when channel is unsubscribed
end
def speak(data)
Message.create! content: data['message'], user: current_user
end
end
BroadcastMessageJob.rb
class BroadcastMessageJob < ApplicationJob
queue_as :default
def perform(message)
ActionCable.server.broadcast 'room_channel', render_message(message)
end
private
def render_message(message)
ApplicationController.renderer.render message
end
end
model message.rb
class Message < ApplicationRecord
belongs_to :user
after_create_commit { BroadcastMessageJob.perform_later self }
Thank you in advance.