Rails3.2 remote select

Hi, I work with remote select. I have two select and in base of the
value of the first select I fill the second select…for example

<%= form_for(@person) do |f| %>

 <%= f.collection_select(:car_id,cars,:id,:tcode, {}, {data:{

remote: true, url: ajax_filter_magazine_car_path(0),“data-type” =>
“json”}}) %>

 <%= f.collection_select(:magazine_id,cars,:id,:tcode, {}) %>

my problem is that rails send to the controller the json in this format

params[:person][:car_id] so name of model and key-value

But I have to execute in many case this operation in differents
form…This format is a problem because the json can be


But i want only params[:car_id]
So in the controller I have to parse in many different way the json…The
is the possibility to send only params[:car_id]?

change the name of select field tag and try once.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs