Questions tagged [stimulus-rails]

5 questions
1
vote
0 answers

fetchOptions body is null on form submit with stimulus.js : Uncaught TypeError: Cannot read properties of null (reading 'set')

I'm trying to create a dynamic search with Ruby on Rails using Turbo and Stimulus controllers. I followed a great tutorial (typeahead-search-tutorial) and was able to get this working seamlessly as an independent (simple) app. Now I'm attempting to…
0
votes
0 answers

How to create a form in Rails with a variable number of jsonb items?

I have a model that stores modifiers for each year, for a variable number of years. It might be 0, it might be 10, it could be 50. The modifiers are not the same, and require different details depending on the type that they are. The modifiers are…
0
votes
0 answers

How to pass a selected value from a simple_form to Stimulus controller

Maybe I could start solving this if I understood where a select from a dropdown is stored/available in a Rails app. Then I have to move get it to the Stimulus controller. Complicated (at least for me) because the information is an image stored with…
Greg
  • 2,359
  • 5
  • 22
  • 35
0
votes
2 answers

simple_form is not capturing Rails Stimulus controller

simple_form is not capturing markup for Stimulus in Rails 7.1, Ruby 3.2.0, esbuild. Or maybe something is wrong with my html.erb Update: I've changed this to reflect where I now see the problem (before I thought it was a Stimulus issue). Two…
Greg
  • 2,359
  • 5
  • 22
  • 35
0
votes
0 answers

Can i implement focus trapping for text input field using stimulus without a controller?

I am trying to implement focus trapping in a search bar using text input field in my ruby on rails app. I can implement focus trapping using using a controller for my search form, but it seems like adding an extra controller just for this task. I'm…