Questions tagged [hotwire-rails]

Hotwire-rails is a collection of front-end tools for Rails available since Rails 6 and enabled by default in Rails 7. Use the [Hotwire-rails] tag for questions about Stimulus, Turbo Drive, Turbo Frames and Turbo Streams and especially their usage in Rails. This tag is not for turbo-links (unless the question is about updating to Hotwire). Also be aware that Hotwire and its components are sometimes used outside of Rails.

See also:

228 questions
2
votes
1 answer

Stimulus not Adding Listeners to Search Form Input

I'm trying to create a search-as-you-type search box on my Rails 7 app. The type-hit-enter search works, and it's loading in a turbo frame, but the js-driven search-as-you-type functionality is broken. The event listener for the search box isn't…
Mitch
  • 130
  • 1
  • 7
2
votes
1 answer

How do I make assertions consistently wait until a turbo frame has been updated?

My system tests are experiencing a race condition leading to inconsistent test results. Sometimes the turbo frame is updated before my assertion (test passes) and sometimes afterward (test fails). View:
<%= form_with…
Eric Mathison
  • 1,210
  • 10
  • 16
2
votes
0 answers

Identical link_to tags, one uses turbo the other doesn't

I have 2 identical link_to tags, that produce indentical html, used in 2 different views. However one sends a turbo request, while the other doesn't (I believe). My goal is for both to use turbo to load a view. The one using turbo works as expected,…
2
votes
1 answer

Turbo Native Android Authentication

I'm basically trying to pass the token stored in Preferences to the turbo fragment. I figured that being stored, it would be usable in the fragments. Are there any tutorials on how this is done? I'm not that well versed in android. For ios => this…
Chrismisballs
  • 167
  • 12
2
votes
0 answers

Get event target after frame loads - Turbo Rails

I have some turbo frame forms in my page that should fire some javascript after they are loaded into the document. Therefore I'm using the turbo:frame-load event listener. To access the element I'd like to use the event's target, as…
derschiw
  • 120
  • 5
2
votes
0 answers

Custom turbo_confirm method as modal

Hello there I've been trying to make custom turbo_confirm modal and i noticed a problem, the modal pops up for a second and thing gets deleted I don't even have time to confirm it or cancel. Here's my code: There's my view with tailwind…
2
votes
0 answers

How can I load tailwind classes that are sent via actioncable broadcast in a rails app?

I'm running a rails app that is heavily using hotwire in some pages. All the CSS in the app is "written" using tailwindcss classes. In some pages there are a lot of turbo broadcasts being sent by the server based on user interaction. One of the…
ilrock
  • 573
  • 8
  • 24
2
votes
2 answers

Rails Turbo-Stream update my div won't work

I am trying to update a div in my page.
I added my controller to the turbo_stream format code in order to update this div respond_to do |format| format.turbo_stream do render…
user1666543
  • 665
  • 1
  • 10
  • 19
2
votes
1 answer

Best practices for handling HTTP 404 responses in Rails using Turbo Frames?

I'm thinking through how Turbo Streams work, mostly as a thought experiment. I understand the basics after building a simple toy application. It's pretty powerful that so much can be done with a handful of Turbo Frames. It's interesting to be able…
Benjamin Oakes
  • 12,262
  • 12
  • 65
  • 83
2
votes
0 answers

Devise flash messages not working with Turbo

I'm running Rails 6.1.4.4 with Devise 4.8.1 and configured my setup to use importmaps and hotwire-rails. When logging in through Devise I no longer get a flash message. I do get flash messages on other parts of the system. In the devise controller I…
map7
  • 5,096
  • 6
  • 65
  • 128
2
votes
1 answer

RoR, page not updating with Turbo_stream DELETE in a turbo_frame

My repo: https://github.com/czepesch/gloss (turboframes-dev branch) I have a list of entries in a glossary. Problem with delete action. Entry is deleted but page not reloading\entry not removing automatically. (same delete action working without…
Alexander V
  • 45
  • 1
  • 5
2
votes
2 answers

Render inside turbo_stream template tag

Why rendering partial inside