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

Ask A Question

Notifications

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.

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.