A: 

If you read the resulting JavaScript you'll see that the parameter in the select simple isn't there. And why would it be? How should it know? You'll get it working using the :with key in the options to observe_field.

<%=
  observe_field(
    :product_category,
    :url => {
      :controller => 'products',
      :action => 'get_subcategories'
    },
    :with => 'id',
    :update => "subcategory_div"
  )
%>
thenduks
A: 

OK. I figured out my problem, and it was silly. The reason I didn't include the :with is because according to the documentation by default the observed value was sent in. Well, after looking at the logs, I did add the :with back in (:with => "value") and it still didn't work. But the problem was in the get_subcategories method of the products_controller. As soon as I changed the params to Subcategory.find_all_by_category_id( params[:value]).sort_by{ |k| k['name'] }, Doh! and voila, it worked.

To all who have responded to this post and others, I thank you for putting up with a new Ruby user who assumed it was some arcane Rails syntax problem, rather than a simple name change.

David D