All Questions
Tagged with ruby-on-rails turbo-rails
66
questions
0
votes
0
answers
43
views
Turbo Stream Response Only Works On Show | Rails 7.1
Part One:
This is my controller action -
def update
respond_to do |format|
if @user.update(user_params)
format.turbo_stream { redirect_to user_url(@user), notice: "...
0
votes
1
answer
55
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
1
answer
68
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") %> ...
1
vote
0
answers
32
views
How do I populate intl-tel-input fields with turbo_stream?
I already have the number saved in my database, using a turbo_stream file and using the turbo_power library I need to change the empty value to the number I have in my database (example: +...
0
votes
0
answers
42
views
Vue Components Not Rendering After Turbo Form Failure
I'm using @hotwired/turbo, rails 7, vue2 and everything seems to work well except when forms fail and a 422 is returned. The form rerenders with errors, but none of the vue components render. All of ...
0
votes
1
answer
59
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
115
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 ...
0
votes
2
answers
267
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 ...
0
votes
0
answers
95
views
How to scroll to the start of the list on Turbo with Stimulus when submitting a form?
I have a Rails 7.1 application with Hotwire. I have a horizontal list that is wrapped in CSS overflow-y: auto and scroll-snap-type: x mandatory.
This horizontal list is a simple render that is wrapped ...
1
vote
1
answer
199
views
Rails 7 turbo-rails error. with render_to_string method of ActionController. Could not render layout: undefined method `headers'
Ruby version 3.2.2
Rails version 7.0.8
Gemfile
source 'https://rubygems.org'
ruby '3.2.2'
gem 'rails', '7.0.8'
gem 'puma', '~> 4.3.9'
gem 'sass-rails', '~>6.0.0'
gem 'jquery-rails'
gem '...
0
votes
1
answer
57
views
Rails Form won't submit after redirecting from another page
This is a weird one and I believe it has something to do with how Turbo works. So I have an update form on one of my screens that looks something like this:
<%= form_with model: @user, url: ...
5
votes
1
answer
3k
views
Rails `link_to` with data-turbo doesnt get TURBO_STREAM request format
(Original question: Does Turbo.setFormMode("optin") disable turbo requests in links? No, the link doesn't work even with Turbo.setFormMode("on"))
Mature app using Rails 6.1, ...
1
vote
3
answers
921
views
Turbo response to render javascript alert?
I am refactoring a Rails controller for turbo and stimulus, and trying to understand how to do things in Turbo that the app does currently with JS response templates.
On a things#show page, I have a ...
1
vote
0
answers
296
views
Rails 7 with turbo and JS event listeners
I use Rails 7 and turbo. I want to use a Bootstrap 5 admin theme but having the following issue:
To bind the click event to the menu toggle button, there is some code like this:
let menuToggler = ...
2
votes
1
answer
856
views
Can't pass current_user into rails 7 turbo stream
I am trying to learn turbo with rails and have come to a problem that I can't seem to figure out. I have a structure where every Applicant has Messages. Two users can send messages to each other ...