All threads / Need to do cascading select lists in Rails 5

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Need to do cascading select lists in Rails 5

Simon P asked in Rails

Hi

Struggling with this one....

Quite a few articles around but most quite old, really would like to use Stimulus but I cant find any pointers.

Have a locations Select.

One a selection is made I want a AJAX style population of the rooms Select where each location has_many rooms.

Any ideas or guidance please?

Simon

I worked it out following:

https://kernelgarden.wordpress.com/2014/02/26/dynamic-select-boxes-in-rails-4/

Just in case anyone comes through here looking for the same.

Will try and redo it in Stimulus when I get chance.

Join the discussion

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

Join 37,629+ 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

    © 2020 GoRails, LLC. All rights reserved.