[Rails] Re: drop downs

Alan Francis
Wed, 26 Apr 2006 13:15:59 -0000

Brian Nice wrote:
> *********** form
>
> <label
for="country">Country
> <select id="country"
name="country"><%=
> options_from_collection_for_select(@countries, "id",
"descr") %>
>
>
>   <%= observe_field(:country,
>                  :update => "country_area",
>                  :url => { :action => :find_areas_for_country },
>                  :with =>
"''country=''+value") %>
>
> <label
for="country_area">Area
> <%= render :partial => ''country_area''
%>
>
>
> ********** partial
>
> <%= options_from_collection_for_select(@country_areas, "id",
"descr") %>
>

You don''t seem to have a div or span with an id of country_area.  tthe
:update => ... bit of the observe_field is looking to replcace the
contents of an element with the results of the action, you need a div to
render into.

Alan.