Install the live chat widget on Ruby on Rails
XACUBE puts a live chat widget on your Ruby on Rails site, so your live agents can answer visitors the moment they ask, from one shared inbox. The free plan covers one agent.
Why XACUBE live chat on Ruby on Rails
- Open
app/views/layouts/application.html.erband paste the code just before</body>. - Publish your site. The chat appears on every page.
<script src="https://chat.xacube.chat/w.js" data-key="YOUR_PUBLIC_KEY" async></script>
Replace YOUR_PUBLIC_KEY with your own key. In your panel, open your website and this code is shown with your key already in it.
Recognise signed-in customers
<% hash = OpenSSL::HMAC.hexdigest('SHA256', ENV.fetch('XACUBE_SECRET_KEY'), current_user.id.to_s) %>
<script src="https://chat.xacube.chat/w.js" data-key="YOUR_PUBLIC_KEY"
data-user-id="<%= current_user.id %>"
data-user-hash="<%= hash %>"
data-user-name="<%= current_user.name %>"
data-user-email="<%= current_user.email %>" async></script>