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
0
votes
0 answers

Issue installing hotwire gem in Rails

Each time after adding the hotwire gem to my gemfile, I always appear to get these responses in my terminal. When attempting to mess around with hotwire it gives me the impression this is causing issues. New to rails so I am sorry if I a missing…
Jack
  • 27
  • 1
  • 7
0
votes
0 answers

Can Turbo.visit update a turbo frame when onChange changes, without changing the URL?

Inside a form we have 2 select and would like to refresh/update the second select when the first select changes, using onChange Example: First select has: onChange:"Turbo.visit(`/sites/index_by_country?country_id=${this.value}`)" Currently this…
viktorsmari
  • 179
  • 1
  • 3
  • 12
0
votes
2 answers

How do you use a turbo frame to replace an object creation form with an object show partial?

I have a model subscription_tier with show and edit actions with corresponding views. I've wrapped each of these with a turbo frame <%= turbo_frame_tag subscription_tier do %> When I edit an existing subscription tier and save it, the turbo frame…
sasav
  • 1
  • 1
  • 2
0
votes
0 answers

Rails console destroy action but is not percolated to the application and handling via turbo stream

A form contains a destroy button <%= button_to 'bomb', message, method: :delete, form: { data: { turbo_confirm: 'R U sure?' } } %> and the controller responds in an expected manner respond_to do |format| format.turbo_stream [logging:…
Jerome
  • 5,583
  • 3
  • 33
  • 76
0
votes
1 answer

Rails Hotwire + Admin Namespace

I have an app running rails 6.1.3.2. I'm starting to migrate to use hotwire instead of ujs. My app uses an admin namespace to allow a user to make edits, create items via this. Example route below - resources :event_attachments namespace :admin do …
0
votes
1 answer

Run Chart.js example with rails and stimulusJS

I want to run the first example of Chart.js inside Ruby on Rails using StimulusJS. But for some reason it just renders an empty canvas (see [3]). This is the html:
Bergrebell
  • 4,263
  • 4
  • 40
  • 53
0
votes
1 answer

Hotwire Modal Form Not Rendering Flatpickr Correctly

I have a modal form that works fine to create a new Detail record via hotwire. Among the fields are flatpickr date field and two flatpickr time fields. If I have validation errors form renders with the errors showing inside the modal, but the…
spacerobot
  • 265
  • 1
  • 5
  • 23
0
votes
1 answer

How to send a broadcasts_to in Rails 6 (hotwire) only when a record with a specific name value is created or updated, and for a specific partial?

I have a Rails 6 View with three numerical integer indicators: speed, temperature and pressure. These values ​​are stored in SavedObject model as serialized objects. And in the controller are passed to the view with their respective instance…
lcchatter
  • 41
  • 2
  • 7
0
votes
1 answer

turbo drive works for a form but not a link

I an experimenting with turbo drive without rails. It seems to work for forms but not links.. even when the form is set to GET. To try to keep it minimal, I have used bash and cgi, but I saw the same thing using another web framework. $ mkdir…
Alex028502
  • 3,486
  • 2
  • 23
  • 50
0
votes
1 answer

Add Hotwire to existing Rails 6.1 app using sprockets

I'm trying to upgrade an existing Rails 6.1 with sprockets app to use stimulus. I installed gem 'importmap-rails' gem 'hotwire-rails' The javascript_importmap_tags causes this error in Firefox Developer Tools: Uncaught TypeError: Error resolving…
rigyt
  • 2,219
  • 3
  • 28
  • 40
0
votes
0 answers

Hotwire turbolinks and problem with event listeners

Hi I have a problem with event listener, I am using turbolinks my listener looks like: document.addEventListener("turbolinks:load", ... when I for the first time visit the page i get in browser console this error: Uncaught TypeError: Cannot read…
0
votes
1 answer

Rails & Stimulus for dynamic nested attribute forms

there, I'm coming back to Rails after years of only using it for APIs. There all sorts of new things and I'm trying to figure out how to accomplish some stuff with the new frameworks. One example is creating a form with accept_nested_attributes…
Brad Herman
  • 9,665
  • 7
  • 28
  • 30
0
votes
2 answers

Problems Integrating Hotwire Into Existing Rails Project

I just joined this community and this is my first post. I’ve been following several Hotwire tutorials and have built some prototypes with the technology. I’ve been impressed with how easy it is to get SPA-like responsiveness with much less…
Bitstack
  • 1
  • 1
0
votes
0 answers

Rails Turbo Frame Tag wrong number of arguments error

I've upgraded to rails 6.1 from rails 6.0 and trying out Hotwire, but I am getting an error when trying to run my application: wrong number of arguments (given 0, expected 1..4) Extracted source (around line #1): <%= turbo_frame_tag 'branch' do %>…
doer123456789
  • 369
  • 1
  • 7
  • 22
0
votes
1 answer

Rails turbo frame response not firing turbo:load

I have a standard inline edit using Turbo, that replaces the turbo frame of the show view with the turbo frame in the _form. But the $(document).on "turbo:load", -> event is not firing in this case. I don't see another event that should be used.…
rigyt
  • 2,219
  • 3
  • 28
  • 40
1 2 3
15
16