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.
hotwire-rails
270
questions
0
votes
1
answer
28
views
Trying to render partial but The response (500) did not contain the expected <turbo-frame id="">
Trying to learn this a bit, but keep running into new issues.
Currently, I have an 'explore' button that is supposed to run some controller code, and pop out a new _partial where it counts down and ...
1
vote
0
answers
25
views
How to preserve the original document's head tag when navigating in a turbo frame with `data-turbo-action='advance'`
The Problem:
I have a component that performs navigation using a turbo frame. I would like to reflect the navigation changes in the window URL for better UX.
According to the Turbo documentation, ...
0
votes
0
answers
18
views
Issue with rails hotwire trix textarea resize
im trying to create a textarea resize grippie more or less like the SO for a trix textarea with rais stimulus so i set this controller below
the issue is when i pull down the textarea the textarea ...
0
votes
1
answer
51
views
Rails: problem with "@hotwired/turbo-rails" and redirects
// app/javascript/application.js
import "@hotwired/turbo-rails"
import "controllers"
import "trix"
import "@rails/actiontext"
import Rails from "@rails/ujs&...
0
votes
0
answers
46
views
Rails: problem with handle redirect with turbo_stream in apps
In the application, when creating a feature, it was necessary to add hotwired/turbo-rails.
// app/javascript/application.js
import "@hotwired/turbo-rails"
import "controllers"
...
0
votes
1
answer
60
views
Rails Turbo Frames: "Content missing" after Update-action (View doesn't update)
I like to use Turbo Frames in my existing Rails-App.
index.view looks now this way:
<h1>Projects List</h1>
<div><strong><%= pluralize(@projects.size, "Project") %> ...
0
votes
1
answer
49
views
Turbo rails broadcast_refresh_to does not connect to stimulus controller
Using turbo 8.0.4.
Blog model:
after_update_commit lambda { |blog| }
broadcast_refresh_to blog
}
In blogs/show.html.erb
<%= turbo_stream_from @blog %>
<%= tag.div data: {controller: &...
1
vote
2
answers
106
views
How to use Rails and Hotwire Turbo Streaming to Stream a Long Page?
I looked at https://turbo.hotwired.dev/handbook/streams and https://www.hotrails.dev/turbo-rails/turbo-streams , but did not see quite how to do this.
I have a long page that many messages. When the ...
1
vote
0
answers
56
views
Javascript error running Rails 7 app on IOS iPhone/iPad
We have an app build in Rails 7 with a Postgres database and uses Bootstrap 5 for the UI components. Pretty basic but effective app.
The app works fine on Windows and Mac browsers and on most Android ...
2
votes
1
answer
94
views
turbo-frame src is updated but html does not render
I have a <turbo-frame id="modal"> tag in my rails layout outside of the <%= yield %> and when I try to render content in the turbo-frame from within the yield it does not render ...
1
vote
1
answer
89
views
How to create a dynamic user form with Devise and Hotwire
I have devise installed as authentication system in my Rails 7 app. I want to be able to create dynamic forms for organization and individual user types using hotwire. That is, when I click on ...
1
vote
1
answer
78
views
Rails 7 turbo frames and multiple forms issue with the form value
I'm very new to Rails. I've found this strange issue related to turbo_frame and multiple new forms.
I have a model Post with comments and when I try to load multiple forms the value from one form ...
1
vote
1
answer
158
views
rails: how to refresh a list with turbo after form validation
I'm kinda following the rails tutorial to learn it and I wanted to learn with turbo.
This is my index.html.erb view:
<%= turbo_include_tags %>
<h1>Notes</h1>
<turbo-frame id=&...
1
vote
1
answer
201
views
Understanding StimulusJS connect() vs initialize() in context of turbo/hotwire
The Stimulus handbook describes the difference between connect/initialize as:
initialize(): Invoked only once, when the controller is first instantiated
connect(): Invoked anytime the controller is ...
0
votes
2
answers
253
views
Setting up Turbo stream broadcasts_refreshes, websocket error
I'm trying to configure a Rails 7.1.3/Turbo 2.0.5 app locally to try out broadcasts_refreshes for a simple model. On the view template that tries to turbo_stream_from this model, I'm getting websocket ...