Ask A Question


You’re not receiving notifications from this thread.

How do i use tom-select with stimulus and hotwire?

Ahmad hamza asked in Rails

I'm using tom-select to either select from the options or create record in the modal. The problem happens when the form submits successfully and that newly created record is now have been selected in the dropdown.

Hotwire easily handles the stuff of showing validation errors on the modal but i'm not sure how to update the dropdown options using stimulus js.


I think i got the solution. I'll share a gist in sometime.


I have pushed my implementation here -


Thanks Ahmad! This helped me out a lot.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 84,256+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.