Action Cable – Integrated WebSockets for Rails

Action Cable seamlessly integrates WebSockets with the rest of your Rails application. It allows for real-time features to be written in Ruby in the same style and form as the rest of your Rails application, while still being performant and scalable. It’s a full-stack offering that provides both a client-side JavaScript framework and a server-side Ruby framework. You have access to your full domain model written with Active Record or your ORM of choice.

You can read more about Action Cable in the Action Cable Overview guide.

Support

API documentation is at:

Bug reports for the Ruby on Rails project can be filed here:

Feature requests should be discussed on the rails-core mailing list here:

Namespace

Module

Class

Methods

Constants

INTERNAL = { message_types: { welcome: "welcome", disconnect: "disconnect", ping: "ping", confirmation: "confirm_subscription", rejection: "reject_subscription" }, disconnect_reasons: { unauthorized: "unauthorized", invalid_request: "invalid_request", server_restart: "server_restart", remote: "remote" }, default_mount_path: "/cable", protocols: ["actioncable-v1-json", "actioncable-unsupported"].freeze }

Class Public methods

gem_version()

Returns the currently loaded version of Action Cable as a Gem::Version.

📝 Source code
# File actioncable/lib/action_cable/gem_version.rb, line 5
  def self.gem_version
    Gem::Version.new VERSION::STRING
  end
🔎 See on GitHub

version()

Returns the currently loaded version of Action Cable as a Gem::Version.

📝 Source code
# File actioncable/lib/action_cable/version.rb, line 7
  def self.version
    gem_version
  end
🔎 See on GitHub

Instance Public methods

server()

Singleton instance of the server

📝 Source code
# File actioncable/lib/action_cable.rb, line 71
                  def server
    @server ||= ActionCable::Server::Base.new
  end
🔎 See on GitHub