i am currently having a very strange problem with observe_field.
i have a select box that looks like this:
<%= select “product_section”, “section”, ProductSection.find(:all, :order => “title ASC”).collect { |p| [p.title, p.id]}, { :include_blank => true } %>
i want to observe the drop down box to have an action happen whenever
the value of the dropdown is changed…
i have added the following code to observe the field:
<%= observe_field(:product_section_section, :update => ‘attribute_data’,
:url => ‘insert_attributes’, :frequency => 1) %>
notice the naming of the field_id in observe field. this does work…
the problem is, when i make a selection, the parameters that get passed
look like this:
params = {“7”=>nil,
“authenticity_token”=>“f245fed70e1760739566121d68a8340a154e086a”,
“action”=>“insert_attributes”, “controller”=>“admin”}
that key/value of “7”=>nil is the one i am interested in… but it seems
like it’s backward. i am thinking i should get a key/value passed that
looks more like:
‘“product_section”=>“7”’
anyone have any idea what i am doing wrong?
thanks!