Guide

Install Free Live Chat on Ruby on Rails

Add a live chat widget to your Rails app by placing a script in your application layout file before the closing body tag.

JH
Jerry Holt
July 25, 2026 · 7 min read

The short version

  • The chat snippet belongs in app/views/layouts/application.html.erb immediately before the closing body tag.
  • Live chat and email support remain free forever with unlimited conversations and no per-seat fees.
  • Rails Turbo replaces the body but keeps the widget active because the script survives navigation.
  • AI is off by default and only costs four cents per response when you choose to enable it.

To install free live chat on Ruby on Rails, open your application layout file located at app/views/layouts/application.html.erb. Paste the script snippet immediately before the closing body tag. This ensures the widget appears on every page of your site. After pasting the code, restart your local server to see the changes take effect.

How do I add the script to my Rails project?

I have spent eighteen years managing front desks and customer operations. I know that when you are ready to fix a problem, you want it done immediately. You do not want a long explanation of why communication matters. You want the widget live so your customers can reach you.

The installation process for a Rails application is direct. You only need to edit one file.

First, open your project in your code editor. Locate the file at: app/views/layouts/application.html.erb

Second, scroll to the bottom of that file. Look for the closing body tag. It looks like this: </body>.

Third, paste the following code snippet directly above that tag:

<script src="https://lastworker.com/widget.js" data-agent-id="YOUR_AGENT_ID" async></script>

Fourth, save the file. If you are running your server locally, restart it. If you are deploying to a production environment, push your changes. The widget will now appear in the bottom corner of every page that uses this layout.

What is the gotcha with Rails Turbo?

I have seen many tools break when they meet modern web frameworks. Rails uses a system called Turbo. It makes your site feel like a single-page application by replacing the body of the page without a full browser reload.

Most guides forget to mention this. They suggest complex event listeners to make scripts work. You do not need that here. Because you are loading the script with an async attribute before the closing body tag, the widget stays active.

Turbo replaces the content inside the body. It does not destroy the script instances that are already running. Your customers can click from your home page to your pricing page, and the chat window will stay open. It will not blink or disappear.

Why should I use this over other tools?

I have worked with eleven front desks at once. I have seen the bills that come from software companies. Most tools make it very difficult to stay on a free plan.

Out of twelve major competitors in the market, four do not even offer a free tier. If you want to use LiveChat, Front, Zendesk, or Intercom, you must pay a monthly fee per person on your team. That gets expensive when you have a growing business.

The other eight tools have free tiers, but they often come with tight limits. Crisp limits you to two seats. If you have three people in your office who need to answer questions, someone is left out. Tidio limits you to fifty conversations a month. In a busy week at the dental practice, we would hit that limit by Tuesday. Once you hit the limit, the widget simply stops working.

LastWorker is different. Live chat and email support are free forever. You get unlimited conversations. You get unlimited teammates. You do not even have to put a credit card on file to start. The shared inbox, contacts, tickets, and the public help center are all included in the free tier.

How much does it cost if I want more?

I do not like hidden fees. I have written phone scripts at 2am because I could not afford to hire more people. I appreciate clear pricing.

At LastWorker, we do not charge for seats or subscriptions. We charge for what you use if you choose to use it.

AI is off by default. Everything is manual until you decide otherwise. If you want an AI to reply to a chat or an email, it costs $0.04 per response. This only happens when it actually generates a reply.

If you want the AI to answer your phone, it costs $0.10 per minute. This price includes the carrier costs. A phone number is $1 per month. Outbound text messages are $0.03 per segment, and inbound text messages are free.

If you just want a human to answer chats on your Rails site, your cost is zero.

How do I manage the conversations?

In the shops I worked with, a lead that stays in a voicemail box is a lead that dies. The same is true for live chat. If a customer sends a message and nobody answers, they go to your competitor.

When you install this script, messages flow into a shared inbox. You can see them on your desktop. Because the inbox is free for unlimited teammates, you can have every person in your office logged in. There is no reason for a message to go unanswered because of a seat limit.

I have watched good leads die because the software was too complex for the staff to use. This system is built to be simple. You do not need to "leverage synergies" or attend a week of training. You just reply to the message like you would an email.

Is there a catch with the free features?

I am not a brochure. I know that "free forever" usually sounds like a trap.

Tawk.to is one of the only other tools among the twelve that offers a truly unlimited free tier. They keep it free by putting a "powered by tawk.to" badge on your site. If you want to remove it, you pay.

We keep the core tools free because we believe the value is in the automation. We want you to use the chat and the ticketing system. We want your business to grow. When you get too busy to answer every chat yourself, we hope you will try the AI features. That is how we make money.

If you never use the AI, the chat stays free. We do not limit your history or your agent count to force you into a paid plan. Zoho Desk, for example, gives you a free tier for three users, but it only includes email ticketing. It does not include live chat at all. You have to pay for their Express plan at $7 per user per month just to get the basics.

With LastWorker, you get the live chat, the email ticketing, and the knowledge base without that monthly bill.

Where does the knowledge base fit in?

When I was running a two-location restaurant group, we got the same questions every day. What are your hours? Do you have gluten-free options? Where do I park?

Writing the same answer ten times a day is a waste of your time. LastWorker includes a free public help center and a knowledge base. You can write your answers once.

The chat widget can link to these articles. This helps customers find answers before they even send you a message. This is part of the free package. You do not have to pay extra to help your customers help themselves.

How do I know it is working?

Once you paste the script into your application.html.erb file and refresh your site, look at the bottom right corner. You should see the chat icon.

Click it. Send a test message. Then, log into your LastWorker dashboard. You should see the message arrive in your shared inbox immediately.

If you do not see the icon, check your Rails console. Make sure there are no syntax errors in your layout file. Ensure you placed the script before the closing body tag.

If you use a Content Security Policy (CSP) in your Rails app, you might need to allow the LastWorker domain. Most basic Rails setups do not have a restrictive CSP by default, so the script should work immediately.

Why skip the AI for now?

I have seen people get excited about new technology and lose their heads. They want to automate everything on day one.

I suggest you start manual. See what your customers are asking. Get a feel for the volume. Because the human-powered chat is free, there is no risk in taking your time.

AI can be a powerful tool for service businesses, but it should be used when you have a clear need for it. If you are missing calls or chats because you are busy with a customer in the room, that is the time to look at the AI options. At $0.10 a minute for phone calls or $0.04 for a chat, it is a cheap way to make sure you never lose a lead again.

But for today, just get the widget live. Open your layout file, paste the code, and start talking to your visitors. It is the fastest way to turn a website visitor into a customer.

Frequently asked questions

Where do I find the application layout file in Rails?

You can find it at app/views/layouts/application.html.erb in your main project directory. This file serves as the wrapper for every page in your application.

Will the chat widget slow down my Rails site?

No. The script uses an async attribute. This means the browser continues to load your site content while the widget loads in the background.

Do I need to pay for a subscription to use the chat?

No. Live chat, email support, and the shared inbox are free forever. There are no monthly subscriptions or per-seat charges for these features.

Does the widget work with Rails Turbo or Hotwire?

Yes. Because Turbo replaces the body content during navigation, the widget script remains active. It survives the transition between pages without needing a full reload.

JH
Jerry Holt
Customer Operations Lead, LastWorker

Jerry Holt has spent eighteen years running customer operations for service businesses, from a two-location restaurant group to a regional dental practice with eleven front desks. He has hired receptionists, written phone scripts at 2 a.m., and watched good leads die in a voicemail box. These days he writes about what actually moves the needle on the phones, in the inbox, and over chat, and where AI earns its place versus where it gets in the way.

Stop letting customers go to voicemail.

Set up in about fifteen minutes. Live chat and email are free forever, so there is no bill to weigh up before you try it.