Params colllection_select observe_field

Hi,

i have 2 dropdowns which are dependent from each other:
ItemCategory has many ItemGroups


/Item/New.html

<%= javascript_include_tag “prototype” %>
<%=
collection_select(:x, :id, ItemCategory.find(:all,
:conditions=>[‘division_id=?’,session[:divisionid]]), :id, :title, :id
=> :itemcategory_id )
%>
<%= observe_field :x_id, :update => :ajaxmessage, :url => { :action =>
“changex”} %>

items_controller.rb
def changex

  #render :text => "test" #OK
  render :text => params[:x][:id]
  >>>>>>>>>NIL NIL NIL NIL

…/*

@servers = ItemGroup.find_all_by_item_category_id(2)

render :partial => “person”

…*/
end

_person
<%= collection_select(:x, :bla , @servers, :id, :title ) %>


if u use the same code in a form where i specify the action within the
form header, everything is good and i recieve the id from the
params-tag. But it is no tworking out of that observer - WHY? params is
always NIL!!!
If i debug it in FFBug, i can see the correct POST-Value…

Any Help is really appreciated, im trying to figure this out since
days…

On Aug 4, 8:14 pm, Tom T. [email protected] wrote:

if u use the same code in a form where i specify the action within the
form header, everything is good and i recieve the id from the
params-tag. But it is no tworking out of that observer - WHY? params is
always NIL!!!
If i debug it in FFBug, i can see the correct POST-Value…

I expect you’ll find that the parameter simply doesn’t have the name
you expect.
Look at the api examples and you’ll see that if you pass :with =>
‘something’ to observe_field
then the observed value is stored at params[:something]. Can’t
remember off the top of my head what the parameter name will be if you
don’t specify :with (possibly just params[:value], but definitely not
params[:x][:id])

Fred