Project

tawk_rails

0.02
No release in over 3 years
Low commit activity in last 3 years
Rails helper for Tawk.to live chat.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.5
~> 0
~> 3.0
 Project Readme

TawkRails

Gem Version Build  Status

Rails simple helper for Tawk live chat script. Work rails >= 4

Installation

Add this line to your application's Gemfile:

gem 'tawk_rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tawk_rails

Usage

Create file tawk.rb in config/initializers/tawk.rb and add

TawkRails.configure do |config|
  config.id_site = 'replace-me-with-your-id_site'
end

Place render method where you want in view.

<%= tawk_init %>

Make sure to put tawk_init into HTML body if you use Turbolinks.

You can pass js methods as string to the helper https://www.tawk.to/javascript-api/

<%= tawk_init "Tawk_API.onStatusChange = function(status){console.log(status);}; Tawk_API.visitor = {name  : 'Name', email : 'email@email.com'};" %>

Contributing

  1. Fork it ( https://github.com/luizpicolo/tawk_rails/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request