Forum: Ruby on Rails Rails3.2 remote select

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Alessio V. (Guest)
on 2017-02-02 10:32
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]?
Anusha M. (Guest)
on 2017-03-09 13:08
change the name of select field tag and try once.
This topic is locked and can not be replied to.