Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

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

![](active_admin_chat_gif.gif)

## Prerequisites
- 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`.

## Installation
Add to Gemfile:
```ruby
Expand All @@ -23,8 +30,8 @@ $ 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
- 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.

Expand All @@ -48,6 +55,9 @@ And including of JS to `app/assets/javascripts/active_admin.js`:
#= require active_admin_chat
```

### Example diagram
![](admin_chat_diagram.png?raw=true "Chat diagram")

## Usage
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.

Expand Down Expand Up @@ -117,11 +127,6 @@ ActiveAdmin.register_chat User do
end
```

## Prerequisites
- 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`.

## Contributing
Bug reports (please use Issues) and pull requests are welcome on GitHub at https://github.com/rootstrap/active_admin_chat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

Expand Down
Binary file added active_admin_chat_gif.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added admin_chat_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.