How to add a feedback widget to a Ruby on Rails app
Where the Bopmigo line goes in a Ruby on Rails app (app/views/layouts/application.html.erb), with code you can copy, and how to test it locally.

Short answer: add the script to app/views/layouts/application.html.erb, just before </body>. Deploy.


Add it to Ruby on Rails
- 1
Create your Bopmigo project
Sign up at bopmigo.com, choose Website, and add your Ruby on Rails address. Copy your line from Install snippet:
HTML<script src="https://bopmigo.com/widget.js" data-project="YOUR-PROJECT-ID" defer></script> - 2
Open it
Open
application.html.erb. - 3
Add your line
Add the tag before
</body>.data: { project: … }becomesdata-project.Ruby on Rails<%# app/views/layouts/application.html.erb %> <body> <%= yield %> <%= javascript_include_tag "https://bopmigo.com/widget.js", defer: true, data: { project: "YOUR-PROJECT-ID" } %> </body> - 4
Go live
Deploy.
- 5
Send yourself a test
Open the live page, choose Feedback and send a short report. It arrives in your Bopmigo inbox (and by email, if you turned that on). Reply, then open Feedback again to see your answer.
Ruby on Rails tips
- Turbo can replace the page body. Test a Turbo visit, Back navigation and a full reload, checking that one Feedback button remains and the report names the current page.
- Mailer and admin layouts are separate; add it there only if you want it.
- If you use Rails’ Content Security Policy initializer, allow
https://bopmigo.com.
Single-page apps and client-side routing
Load the script once in the root layout, not per page. Bopmigo notes the page people are on when they report, including after client-side navigation, so there’s nothing to re-run on route changes.
Testing locally
Add your local address (for example http://localhost:3000) to the project in Bopmigo, alongside your production address. Reports are only accepted from addresses you list.
What Ruby on Rails users tend to report
- Turbo navigation that leaves a page half updated.
- File uploads that fail on large phone photos.
- Admin pages that are slow with real data.

Your first week
- 1
Day 1: test locally and in production
Send a report from localhost and from your live site, and check both arrive in the same inbox.
- 2
Days 2 to 5: identify signed-in users
Pass the user ID and any useful context, such as plan or account, so each report says who it came from.
- 3
Days 6 and 7: route reports to your tracker
Copy reports that need code changes into your issue tracker, and reply when the fix ships.
Questions
Does it need a gem?
No. It’s a hosted script.
Can I use a different project for staging?
Yes, read the ID from credentials or an environment variable.
Why doesn’t the button show?
Check that the address you’re on is listed in your Bopmigo project, that the change is live, and open a private window in case of caching. If your site has a Content Security Policy, allow https://bopmigo.com.
More: all install guides · website options · install with a coding agent