Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
denshobato_chat_panel
Advanced tools
DenshobatoChatPanel, is a official addon for Denshobato Gem, it provides simple chat panel for you. If you don't need any special customization for dialog panel, or if you want to try messaging quickly, you can use chat panel.
Add this line to your application's Gemfile:
gem 'denshobato_chat_panel'
And then execute:
$ bundle
Or install it yourself as:
$ gem install denshobato_chat_panel
rails g denshobato_chat_panel:install
This command copies assets to vendor/public/assets
#####1. Add method denshobato_chat_panel
to your model
class Customer < ActiveRecord::Base
denshobato_for :customer
denshobato_chat_panel
end
#####2. Copy this line to your config/initializers/assets.rb
Rails.application.config.assets.precompile += %w( denshobato.js )
#####3. In your application.scss import css
@import 'denshobato';
#####4. In layouts/application.erb
include javascript file in the bottom
<body>
<div class='container'>
<%= render 'layouts/header' %>
<%= yield %>
</div>
<%= javascript_include_tag 'denshobato' %>
</body>
#####5. Mount API route in your routes.rb
mount Denshobato::DenshobatoApi => '/'
#####6. On the page with your conversation, e.g localhost:3000/conversation/32
, add this helper with arguments
= render_denshobato_messages(@conversation, current_user)
// => When @conversation = Denshobato::Conversation.find(params[:id])
// => and current_user is your signed in user, e.g Devise current_user etc.
You need to set up name and image for chat independently. By default, name show a class name of model, e.g Customer, or User, and a gravatar.
Go to your user model and rewrite these methods.
class User < ActiveRecord::Base
denshobato_for :user
denshobato_chat_panel
def full_name
"#{first_name}, #{last_name}"
end
def image
avatar.url
end
end
Bug reports and pull requests are welcome on GitHub at https://github.com/ID25/denshobato_chat_panel.
The gem is available as open source under the terms of the MIT License.
Copyright (c) 2016 Eugene Domosedov (ID25)
FAQs
Unknown package
We found that denshobato_chat_panel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.