У меня есть app_key, key и secret в ApplicationController
мой PusherController:
def auth
if current_user
auth = Pusher[params[:channel_name]].authenticate(params[:socket_id],
:user_id => current_user.id, # => required
:user_info => { # => optional
:name => current_user.name,
:email => current_user.email
}
)
render :json => auth
else
render :text => "Not authorized", :status => '403'
end
end
Мой JS
var pusher = new Pusher("key");
Pusher.channel_auth_endpoint = "/pusher/auth";
Pusher.channel_auth_transport = 'json';
channel = pusher.subscribe("presence-content_editing");
Я почти уверен, что следовал инструкциям http://pusher.com/docs/presence-1.6
Но я просто запутался, почему я получаю эту ошибку
this is the error :
Uncaught TypeError: Cannot call method 'scopedTo' of undefined
Pusher.Channel.PrivateChannel.authorizepusher.min.js:38
Pusher.subscribepusher.min.js:13
Pusher.subscribeAllpusher.min.js:12
connection.bind.bind.cpusher.min.js:10
a.emitpusher.min.js:17
jpusher.min.js:25
_machine.b.Machine.connectedPostpusher.min.js:29
apusher.min.js:19
c.transitionpusher.min.js:20
w