rails: Rails 5 beta 3: Cannot read property 'subscriptions' of undefined
Ruby 2.2.3
rails g channel foo_bar speak
Enabled cable in router, then restart server. Now got:
Cannot read property ‘subscriptions’ of undefined
which point to:
(function() {
App.foo_bar = App.cable.subscriptions.create("FooBarChannel", {
connected: function() {},
disconnected: function() {},
received: function(data) {},
request: function() {
return this.perform('speak');
}
});
}).call(this);
And:
Uncaught SyntaxError: Failed to construct
this.webSocket = new WebSocket(this.consumer.url);
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (9 by maintainers)
Yes. By default the
action_cable_meta_tag
is present inapplication.html.erb
. If you are using that layout then the page source should contain the meta tag as follows -