Questions tagged [turbo-rails]
67 questions
10
votes
3 answers
New Rails 7 Turbo app doesn't show the data-turbo-confirm alert messages don't fire (turbo-rails 7.1.0 and 7.1.1)
New Rails 7 app created in 2021 or 2022, when I click on a form with data-turbo-confirm, the alert message does not show.
<%= form_with url: root_path(), data: {'turbo-confirm': "Are you sure you want to submit this form?"},
method:…

Jason FB
- 4,752
- 3
- 38
- 69
10
votes
1 answer
Turbo-Rails with Devise does not redirect Consistently Rails 6.1.3 Devise 4.7.3 Turbo Rails 0.5.9
THIS IS A COMPANION TO https://github.com/hotwired/turbo-rails/issues/122
REPRODUCTION APP CODE: https://github.com/jasonfb/TR001
Using
Rails 6.1.3
Devise 4.7.3
Turbo Rails 0.5.9
Symptom 1:
-- using Turbo-Rails + Devise
When I click "Log In", the…

Jason FB
- 4,752
- 3
- 38
- 69
8
votes
3 answers
Getting a Turbo Frame Error of "Content Missing"
I'm trying to use turbo_frame_tag in my Rails application to manage some tasks. I created a scaffold for my tasks.
I wrapped the page I want to use inside of a turbo frame tag as below:
<%= turbo_frame_tag "modal" do %>
New task
…
folwarczyk
- 81
- 1
- 2
6
votes
1 answer
Rails Turbo.visit with post request
I am trying to initiate a post request programatically.
Turbo.visit('documents/path', { data: { 'turbo-method': 'post' } });
This is not working, it triggers a GET request.

Petros Kalafatidis
- 575
- 5
- 15
6
votes
2 answers
Adding a Stimulus click action to a Turbo link?
I am doing an inline editing feature on the show page with the 'Edit' button above the frame that loads with turbo. Trying to add a toggle on the edit button that it switches to the cancel button in edit mode.
Figured a simple stimulus controller…

Dan Tappin
- 2,692
- 3
- 37
- 77
5
votes
2 answers
Rails Turbo doesn't trigger turbo:load event
The turbo:load event is not fired after a turbo visit (as the documentation says it should). It works as expected after the initial full-page load. I can catch the "turbo:before-fetch-response" event, but I have no luck with turbo:load, :render,…

BEEK
- 151
- 2
- 5
5
votes
2 answers
Hotwire Rails - Cannot use import statement outside a module
I have installed hotwire-rails in an existing Rails project. Before even writing any hotwire related code I get the following error on the browser console on every page:
Uncaught SyntaxError: Cannot use import statement outside a module in…

StuartFrost
- 299
- 3
- 9
5
votes
3 answers
Turbo_stream format not being sent anymore
we are currently working on changing our web app search engine from Stimulus to Turbo.
However, we keep getting an HTML request instead of a Turbo one from our script with the error : “
ActionController::UnknownFormat “.
Trying to force the request…

Bolo
- 2,668
- 4
- 27
- 34
4
votes
2 answers
Rails 7: unpermitted authenticity token
I found a bug in a feature someone else made in a project I was hired to help with. The programmer who did this is unavailable, and I found nothing on the internet about this error, so I'm hoping someone here has ideas on what could be the…

Camila
- 41
- 4
4
votes
1 answer
Turbo Drive not intercepting link clicks (but turbo:load event fires)
I'm experimenting with adding Turbo to a Rails 6.1 app.
It seems to be loading (see "What I've tried"), but when clicking around the clicks does not seem to be intercepted. I'm still getting full page reloads.
Can anyone help me spot what is missing…

rogerkk
- 5,494
- 5
- 37
- 53
4
votes
0 answers
Links inside a turbo frame with data-turbo-action="replace" (for instance: pagination links) are triggering 'turbo:load' on the page
Picture a very common use-case described in the official Handbook: a that contains pagination links.
So, turbo supports (encourages?) annotating these pagination links with data-turbo-action="replace", and the resulting experience is…

sandre89
- 5,218
- 2
- 43
- 64
4
votes
1 answer
Rails: Turbo Stream Broadcast not updating view
I have a Turbo Stream which is not updating the view and I'm not sure why. I have two other broadcasts setup in a similar configuration which are working fine.
Everything looks like it should be working from what I can see, I'm just not getting the…

Phil-6
- 552
- 6
- 16
3
votes
1 answer
Ruby on Rails 7 Hotwire Turbo in table html
I have a simple ruby on rails 7 app that uses Hotwire and turbo frames. I have a HTML table on my index page, and would like to make it with turbo frame tag, so that all the actions stay on index page.
Here is the index file:
<%= turbo_stream_from…

Volkan
- 494
- 3
- 14
- 32
3
votes
1 answer
Events not loading on first page load but works after refresh
I am creating an app called Employee Management System using Rails 7. To add an employee, I have created a form. Here I have used nested-form-fields gem for adding contacts of employee. The problem is when the form is loaded the first time, when I…

Aditya Gadekar
- 133
- 9
2
votes
2 answers
How to check if there are subscriptions to a broadcast in turbo rails?
In my Rails view I’m using turbo_stream_from to subscribe to a turbo stream broadcast to display a list of patients:
<%= turbo_stream_from :all_patients %>
I want this list to be updated when a new patient is created, so I…

Evgenii
- 36,389
- 27
- 134
- 170