将多个参数传递给操作电缆导轨

时间:2020-12-22 01:32:01

标签: ruby-on-rails actioncable

Rails, actioncable npm

cable.subscriptions.create(
                { channel: 'PracticeChannel', room: 'Room5' },
                {
                    received: ({ refetch }) => {
                        if (refetch) {
                            
                            // emit some events. 
                            
                        }
                    }
                }
            )

如何传递另一个参数,例如 room

我试过, { channel: 'PracticeChannel', room: 'Room5', newParam: 'somevalue' } 造成了这个问题

在 Rails 日志中:

Could not execute command from `({"command"=>"subscribe", "identifier"=>"{\"channel\":\"PracticeChannel\",\"room\":Room5}"})` 

0 个答案:

没有答案
相关问题