Skip to content
ActiveAdmin chat plugin
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Recomendations Dec 5, 2018
config Fix Travis integration Dec 7, 2018
gemfiles Add testing in travis with different versions Dec 11, 2018
lib Fix Travis integration Dec 7, 2018
spec Add testing in travis with different versions Dec 11, 2018
.rubocop.yml Add testing in travis with different versions Dec 11, 2018
.travis.yml Add required ruby version Dec 14, 2018
Gemfile Initial commit Oct 19, 2018
MIT-LICENSE Add gif to readme Dec 13, 2018
Rakefile Add TravisCI Oct 31, 2018
active_admin_chat.gemspec Add required ruby version Dec 14, 2018
package.json Add Sass Lint and fix styling issues Nov 5, 2018


Build Status Maintainability Test Coverage

Get a chat for your ActiveAdmin app out of the box.


  • It assumes you have models for your admins and users in place.
  • It assumes that your users have an email attribute.
  • For production you need to configure ActionCable by providing it with a Redis or Postgres connection in config/cable.yml.


Add to Gemfile:

gem 'active_admin_chat'

And then run:

$ bundle install

Install ActiveAdminChat:

$ rails generate active_admin_chat:install

It will generate:

  • Conversation and Message models and migrations.
  • Initializer that configures the model names for conversation, message, admin user and user.
  • Default chat page.

You can customize the namings of the models when installing ActiveAdminChat with the usage of the --conversation_model_name, --message_model_name, --admin_user_model_name and --user_model_name flags.

For example:

$ rails generate active_admin_chat:install --conversation_model_name=chat

Once you've successfully installed ActiveAdminChat, run:

$ rails db:migrate

Add including of CSS to app/assets/stylesheets/active_admin.css.scss:

@import 'active_admin_chat';

And including of JS to app/assets/javascripts/active_admin.js:

#= require active_admin_chat

Example diagram


All you need to get the chat up and running is to authenticate your users in the websocket connection in app/channels/application_cable/connection.rb. It's important that you identify them as the current_user here, this will be used by the gem internally.

For example with the devise gem:

module ApplicationCable
  class Connection < ActionCable::Connection::Base
    identified_by :current_user

    def connect
      self.current_user = find_verified_user


    def find_verified_user
      verified_user = env['warden'].user

      reject_unauthorized_connection unless verified_user



You can change the chat page name and namespace the same way you do with other ActiveAdmin pages.

If you'd like to change the chat styling you can override the following classes:

  • .active-admin-chat__title: Title above the conversations list
  • .active-admin-chat__conversations-list-container, .active-admin-chat__conversations-list and .active-admin-chat__conversation-item: List of conversations
  • .active-admin-chat__conversation-history-container and .active-admin-chat__conversation-history: Conversation panel
  • .active-admin-chat__message-container: Message in the conversation panel
  • .active-admin-chat__send-message-container: Send message button

If you'd like to change the whole HTML you can do it in the chat page by specifying its content:

ActiveAdmin.register_chat 'Chat' do
  content do
    # your code

If you'd like to change the controller actions you can do it in the chat page by specifying its controller:

ActiveAdmin.register_chat 'Chat' do
  controller do
    def show
      # your code

If you'd like to add a button in the user's index in the admin dashboard to start a chat with a user:

ActiveAdmin.register_chat User do
  index do
    # your code
    actions do |user|
      send_message_link user


Bug reports (please use Issues) and pull requests are welcome on GitHub at This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.


The gem is available as open source under the terms of the MIT License.


Active Admin Chat is maintained by Rootstrap with the help of our contributors.

You can’t perform that action at this time.