Questions tagged [turbo]

201 questions
4
votes
1 answer

How to delete and redirect out of a turbo frame

I need to delete a record using standard routing and redirect to a separate page. The link needs to be within a turbo frame and have a confirmation message. I'm using rails 7 and would expect the following to work; # _form.html.slim <%=…
JesseWelch92
  • 109
  • 10
4
votes
0 answers

Sharing font files in Turbo monorepo project

I've built a mono-repository project with Turbo. I have 2 Next.js projects in this repo. I want to share font to each Next.js project. apps |- next_project1 |- next_project2 packages |- pulbic // I am not sure it is correct |- components ... In…
kyun
  • 9,710
  • 9
  • 31
  • 66
4
votes
0 answers

turbo_stream_from suddenly stopped working

I'm running a rails 6 app that is heavily using all sorts of hotwire goodness. I noticed that after a deploy my turbo streams stopped working. In my view I've got <%= turbo_stream_from "#{dom_id(@class)}_lesson" %> Which in theory should start…
ilrock
  • 573
  • 8
  • 24
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

Turbo frame not loading html when using src attribute

I am trying to load html into a turbo frame using the src attribute, but when I load the page the frame exists on I don't see a network request being issued to get the html. This is the markup I have written on the rendered page: <%= turbo_frame_tag…
Jbur43
  • 1,284
  • 17
  • 38
4
votes
2 answers

how to redirect a form within turbo_frame?

I need to add a button that persists the data of the following form but that when pressing it resets the view and stays in it, without redirecting to the index of the controller, I have tried an ajax call but I don't know why it didn't work for…
cisco
  • 165
  • 1
  • 8
3
votes
3 answers

How to fix turborepo warning: failed to contact turbod

I'm getting this warning when I run my Turborepo project. My current turbo version is 1.7.0. I get this warning at every initial start of my app using yarn dev. Once the app is running I do not get any issues or warnings after that. The warning…
Simran Singh
  • 2,323
  • 12
  • 21
3
votes
1 answer

Test turbo stream action using Rspec

I am doing a rspec test for a controller action that use turbo stream : describe 'GET /CONTROLLER_NAME' do it 'return a turbo stream answer' do get :index, as: :turbo_stream expect(response).to eq Mime[:turbo_stream] end …
Syl
  • 3,719
  • 6
  • 35
  • 59
3
votes
1 answer

Turbo stream partial rendering as plain text in Rails 7

I'm building a new Rails 7 app and trying to follow the intended default uses of turbo streams for ajax content replacements (and stimulus where other JS control is needed). This is my first time using Turbo Drive. I'm also using view components…
rdnewman
  • 1,379
  • 20
  • 28
3
votes
1 answer

yarn not installing packages from workspace but instead tries pulling down from npmjs with turborepo

Version: "packageManager": "yarn@1.22.19" I have based my project off of the npx create-turbo@latest command. I have eslint-config-custom and tsconfig projects inside my /packages folder which I reference in my three nodejs apps with: "tsconfig":…
SebastianG
  • 8,563
  • 8
  • 47
  • 111
3
votes
1 answer

Rails 7 + Turbo: Turbo navigates away when receiving 422 unprocessable entity

According to various sources, the way to fail form validation in Rails 7 is to respond with status 422 unprocessable entity. However, in my case, this causes Turbo to issue yet another GET request, which is unlikely to be the desired outcome. The…
Kalsan
  • 822
  • 1
  • 8
  • 19
3
votes
1 answer

Capybara feature specs fails with Turbo Drive

I'm experimenting with introducing Turbo Drive on a couple of pages in my Rails 6.1 app. Ḯ've got it as expected after moving some legacy JQuery plugin initialization from $(document).ready() calls into document.addEventListener('turbo:load', ..)…
rogerkk
  • 5,494
  • 5
  • 37
  • 53
3
votes
3 answers

Ruby On Rails - CRUD - Destroy/Delete Not Working?

I've gone through a good chunk of this tutorial, and have gotten to the part where functionality for deleting articles is added: https://guides.rubyonrails.org/getting_started.html ...but whenever the 'Delete' link is clicked on, the article is not…
Bryan Green
  • 441
  • 3
  • 18
3
votes
1 answer

Program that determines if a number is odd or even shows the wrong output if number is longer than 5 digits

If I enter a number that's more than 5 digits long, it shows the wrong number. For example: Enter Integer: 123456 -7616 is EVEN.-7616 is ODD. My teacher wants us to use Turbo C++ but it sometimes freezes for me after I run a program so I used…
Banana
  • 39
  • 4
3
votes
2 answers

Hotwire not updating list with projects

I have Hotwire setup in my Rails app, but it doesn't update the index view with projects. I have a simple projects view:
    <%= turbo_stream_from "projects" %> <%= turbo_frame_tag…
John
  • 6,404
  • 14
  • 54
  • 106
1
2
3
13 14