Population of drop down list contents from a prior drop down selection

Suppose you have two drop down selects that are related. The contents
of both come from a database.You want the contents of the second one
to be dependent on the selection made in the first one, but don't want
the user to have to hit SUBMIT to make the contents populate. For
example, say the goal is to implement a role based access framework
and the first drop down is the controllers available for a given
right. Once the user selects a controller, you want the next drop
down populated with only the actions available for that controller.

I suppose that this is an AJAX thing, but wasn't sure how to do it.

Any suggestions?

RJS and partials. Replace the second drop down with a new version
when the first drop down is changed.