populating a select box on changing another selectbox elemnt

Hello frnds,
   I hav 2 select boxes.
First select box is populated with all the "distinct states".On
selecting a state I want the 2nd selct box to be populated with its
corresponding "districts".
On selecting the district,I want some data to be displayed for that
corressponding district.
I am able to display the data on selecting the "district".(using RJS
template and partial)
But the 2nd select box is always populated with all the districts.It is
not populated accoring to the selection of first selectbox.
Can you help me in solving this problem?

things that i tried

I'm still new to Rails so pardon me if I misunderstand your issue, but I believe the answer is to use

1) collection_select
2) :onchange

You'll probably find your way here :
http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/

Christophe

http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/

Hai Christophe,
   Thanks 4 ur reply.This is certainly good tutorial..
Thanks a lot.....

Veena