ActionCable channel not accessible outside rails plugin
<p>I'm trying to create a gem which exposes an ActionCable channel, but I can't get it to work.</p>

<p>This is my gem</p>

<pre><code># lib/my_channel.rb
class MyChannel &lt; ActionCable::Channel::Base
  def wait(data)
    # logic ...
  end
end

# lib/engine.rb
module MyApp
  class Engine &lt; ::Rails::Engine
    isolate_namespace MyApp
  end
end
</code></pre>

<p>I then add the gem to my main applications <code>Gemfile</code>, run <code>bundle install</code>, start up the console and run <code>MyChannel</code>. Which don't yield and error, meaning that the channel as been included properly.</p>

<p>I then add this to my main application</p>

<pre><code>// application.js
var socket = "ws://localhost:3000/cable";
var cable = ActionCable.createConsumer(socket);
cable.subscriptions.create({ "channel": "MyChannel" }, {
  received: function(){
    // ...
  }
});
</code></pre>

<p>But I'm getting this error</p>

<pre><code>Subscription class not found ({"command"=&gt;"subscribe", "identifier"=&gt;"{\"channel\":\"MyChannel\"}"})
</code></pre>

<p>What am I missing?</p>