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

<%= f.select(:city_2, @city_select) %> <%= f.select(:city_1, @city_select) %> 
  • one
    Only Javascript'om. I recommend adding the appropriate tags and listing the resulting markup from these two lines so that the JS'eram could say something to that. - D-side

1 answer 1

RoR is a backend, it knows nothing about what is happening in your front end until you send this data to it. Ajax not needed here, you need Javascript .

  • The minus is not mine, but I can explain why he is: he doesn’t bring the author closer to a decision. Here it is much more productive to get the issue edited by the author, so that JavaScript followers can tell how this is done. Do not rush to answer questions that have not yet been formalized. - D-side