Skip to main content

Need to do cascading select lists in Rails 5

Rails • Asked by Simon P

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.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.