Questions tagged [turbo]
201 questions
0
votes
0 answers
Rails 7 Javascript not working on first page load
I have a Rails 7 app, where users can upload photos to a post. I've used Javascript (client side) to create the drag and drop upload file upload field, but it doesn't work when the page is loaded the first time. If you refresh the page, it works as…

Harry Mattocks
- 83
- 8
0
votes
0 answers
Ruby on Rails 7 - page loaded twice when use 'data-turbo-track': 'reload' on it
I use rails 7 with importmap. On view I added
<% content_for :head do %>
<%= javascript_include_tag 'path/to/script', 'data-turbo-track': 'reload' %>
<% end %>
for run script only on it. After that the page is always loaded twice when you go to…

infernal
- 23
- 4
0
votes
0 answers
How to insert after or before with Turbo::Broadcastable
I'm trying to insert something after a div using broadcast_append_to and i noticed that what I'm inserting it's appended inside the target div.
Ex:
index.html.erb:
<%= turbo_stream_from "divs" %>
Broadcast…

Paul Bob
- 441
- 3
- 10
0
votes
1 answer
Rails 7 with devise how to yield login page
I would like to display my login partial on the landing page. I have constructed a 2 layout site in Rails 7, views/layouts/application.html.erb and views/layouts/landing.html.erb. Each contains a yield.
When not logged in I go to the landing page…

JensAlsted
- 43
- 4
0
votes
2 answers
Creating three Dependent Drop-Downs With Ruby on Rails 7 and turbo/stimulus
I wanted to create a three dropdown selects category>subcategory>susubcategory
I have followed this method here https://www.youtube.com/watch?v=ap551f2a_d0 with some changes to suit my needs. everything seemed fine and each dropdown gets populated…

ukeagle
- 65
- 1
- 10
0
votes
0 answers
Kaminari including POST params in page links after turbo create
I have a set of pagination links in a table which gets refreshed in POST requests, with a turbo stream.
My problem is that if I click a pagination link immediately after I create a new Car record, the pagination links change to include the params of…

s89_
- 1,533
- 3
- 25
- 40
0
votes
1 answer
Nil location provided. Can't build URI error with project tasks turbo stream
I have a projects model that has many tasks. You can click a checkbox to complete the task and what I am trying to have happen is when that happens change the style of the task and return some additional information. The task updates fine and…

spacerobot
- 265
- 1
- 5
- 23
0
votes
1 answer
Trouble implementing Infinite Scrolling With Rails 7, Stimulus, Kaminari gem and filtering/sorting functionality
I'm trying to implement infinite scrolling in a cocktail recipe app using Rails 7, Stimulus/Turbo and the Kaminari gem for pagination. Everything functions as it should when I am simply filtering all records sent from the controller. Meaning, the…

baconsocrispy
- 81
- 2
- 8
0
votes
1 answer
Warning of running Turbo script from the body, and content wrongly placed above the nav bar
I can't figure out what is causing this. I have searched extensively on this site and elsewhere and can't find an instance of this same problem. This should be a simple blog as part of a Udemy course. However, any content added to the blog is…

DebakeDSP94
- 35
- 1
- 7
0
votes
1 answer
Turbo Stream Form not working when refreshing partial
I'm trying to create a form with a turbo_stream format request. This is my form
<%= form_with url: search_stock_path(format: :turbo_stream), data:{ method: :get, turbo: true}, method: :get, turbo: true do |f| %>

abner DC
- 11
- 2
0
votes
0 answers
Turbo Stream returns correct html, but when mounted to the dom it's hidden?
I'm using rails 7 with tailwind
I have a form that I want users to be able to append select inputs to, so I've set up the form to use a turbo stream. It is almost working, but I'm seeing some odd, unexpected behavior.
When the turbo stream responds…

Jack Collins
- 339
- 1
- 2
- 13
0
votes
0 answers
fields_for fields disappear in devise on rails 7 when error occur
In my rails 7 app with devise set up i got the registration#new view modified to appear in my design.
My user model also has_one :account which stores information i dont want to be in the user model since it's bad practice to migrate columns into…

GabrielTheCoder
- 88
- 9
0
votes
1 answer
Flowbite and Turbo Rails 7 with import map
Please help me, how to use Flowbite and Turbo Rails 7 with import map?
I use Flowbite v.1.5.3 as here https://flowbite.com/docs/getting-started/rails/
and tailwindcss
I found it https://github.com/themesberg/flowbite/issues/88 and i change…
0
votes
0 answers
Why is turbo rails remove action not removing this div and returning this error?
I've got a Rails 6 app using turbo-rails. In my HTML I'm rendering a div like so
When I click a button_to tag I trigger the destroy action that runs a destroy.turbo_stream.erb view file
<%= turbo_stream.remove…

ilrock
- 573
- 8
- 24
0
votes
1 answer
rails 7 link_to delete method not working
<%= link_to "Destroy", article_url(article), data: { turbo_method: :delete, turbo_confirm: "Are you sure?"} %>
its generated wrong link but after rebooted PC it generate proper link:

roman
- 11
- 3