I'm trying to use the results of an auto complete form in a field observer. The problem is the value of the field is just a select item in a UL. So if I have this:
<%= text_field_with_auto_complete :school, :name %>
<%= observe_field 'school_name', :url => {:action => 'get_students_by_school'}, :update => 'student_list', :with => 'school[name]' %>
I type 'an', select 'Anderson High' or whatever and the parameters look like this:
"school"=>{"name"=>"an"}
My latest hack attempt was to have the observer render a link_to_remote button ('find school') with the value of li.selected as its id. Couldn't get that to work.
When you submit the form, obviously the value of the school[name] parameter is correct, so I'd like to know how I can recreate this functionality in my field observer.
As an aside, I can't find the documentation on the auto complete helper in the API.