I have a ruby program which displays two dropdown lists. When the first list is modified, I want to automatically change the data in the second dropdown list. I don't know how to do this in Ruby on Rails.

In normal HTML/Javascript, I would use OnChange (or OnClick) to involk a Javascript function which presses a refresh button. When the refresh button is pressed, the initial form would regain control and would populate the second dropdown list.

What I don't understand is how Ruby on Rails actually determines what program to run next. I can see the routes table which seems to be used to connect a path to a program name.....but how do I determine the initial path?