Ask A Question

Notifications

You’re not receiving notifications from this thread.

Stimulus_Reflex Demo's - Populating Dropdowns from tables

Matthew Frederickson asked in Rails

So, I've spent about two days on this, Googling, watching many, many YouTube videos. So much that I'm on information overload - and obviously missing something. I've worked through the Stimulus.js demos on their page. What I'm looking for is simple - if you look at their demo page - the geo_tracker does what I want - select a region - that populates the and shows the next dropdown of countries. I've been through their code, but can't quite figure it out. I think what I want to do would be well suited for Stimulus_reflex. But I can't seem to find the right article, or the right demo, or the right video (and yes, I subscribe to gorails but the demos don't qquite do what I want).

Am I on the right track, or is there an easier way to do this? If it is the right track - can you point me to the tutorial I need to follow, the YouTube video I need to watch, or the article I need to read?

Any help is appreciated.

Reply

Hey Matthew, kinda old but did you figure this out? From what I gather you're trying to have one drop down where when the user selects a value it updates values in another dropdown. If so hit me up as I have a working example of this.

Reply

No I didn't - that would be great - thanks.

Reply

Hey - this is all I had to do to get it working. If you're on slack I can send you a video of how that looks. https://gist.github.com/tabishiqbal/e8959c594d25c5306255e276daf9f240

Reply
Join the discussion
Create an account Log in

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

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

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