Non model cascading selects

In my model I have a city_id. ON the form I am using a cascading select
to select the state, which then does a remote_submit to get the list of
cities (and hence the city_id) for the selected state. The problem that
I am having is that if I make a selection, hit SUBMIT and validation
fails, the original selected state/city is now reset (ie, the values
aren’t saved). Since they aren’t part of the model do I assign them to
the flash or session? How do you set the initial values from these


initialize it in the controller and the re-assign it in your remote
action in the controller, form the params

def create

do your stuff

@selected_city = params[:city]
@selected_city ||= City.first
render :action => show

then you can use @selected_city when you come back to the view

<%= select ( …, :selected => @selected_city %>

hope it helps