Simple Rails chat plugin that allows users to talk to one or more people at a time that leverages ActionCable.
A demo of functionality can be found: https://chatgem.herokuapp.com/
- This gem relies on ActionCable therefore Rails 5.0.0 is a minimum.
- For help setting up ActionCable when coming from an older version of Rails, view this.
- An authentication system must be setup before installing
chat, like Devise, Clearance, or your own custom solution. The generator will only run unless a users table exists.
- Chat assumes that a
current_userview helper method exists.
- Your connection should be identified by
current_user. You can learn more about how to set this up by reading here.
Add Chat to your application's Gemfile:
And then execute:
Run the installer to setup migrations and helpers and then migrate:
❯ rails generate chat:install ❯ rails db:migrate
//= require chat
Require chat in your app/assets/stylesheets/application.css file
*= require chat
Finally, add the following line to your application.html.erb file or any view file you'd like Chat available from:
<%= render_chat %>
Dot commands behave differently than regular messages and begin with a dot(.). The following commands are available:
- .shrug followed by an optional message outputs a srugging emoticon
- .gif following by a label fetches a random gif from giphy with the given label
Bug reports and pull requests are welcome on GitHub at https://github.com/npezza93/chat.
The gem is available as open source under the terms of the MIT License.