Skip to Content Skip to Search

Description:

Generates a new cable channel for the server (in Ruby) and client (in JavaScript).
Pass the channel name, either CamelCased or under_scored, and an optional list of channel actions as arguments.

Example:

bin/rails generate channel Chat speak

creates a Chat channel class, test and JavaScript asset:
    Channel:    app/channels/chat_channel.rb
    Test:       test/channels/chat_channel_test.rb
    Assets:     app/javascript/channels/chat_channel.js