ruby-on-rails – Link rails dropdowns

Question:

How to exclude an item selected in the first list from the second list?

<%= f.select(:city_2, @city_select)  %>

<%= f.select(:city_1, @city_select)   %>

Answer:

RoR is a backend, it does not know anything about what is happening in your front-end until you send this data to it. Ajax not needed here, Javascript needed here.

Scroll to Top