passing two id values through :with?

Hai frnds,

    I hav two select boxes.1st selectbox for selecting the "state" and
the 2nd selectbox will be populated with the "districts" based on the
1st select box value.I want to show some details according to the
district selected.

I am able to do these things.But i want to get both the id of 1st and
2nd select box in the action "show_readings_for_station".Can i pass two
ids with periodically_call_remote?

my code
<%= periodically_call_remote(:url => { :action=>
"show_readings_for_station" }, :frequency => 5,

"_district_id" is the id of 2nd select box. "_state_id" is the id of 1st
select box.


yes but different parameters name like one is district_id and state_id


If you need to pass two values using periodically call remote,
trying :with option is a good idea. Yes, we can pass more than one values with it.

Have a look at this, and try to follow the same -

, :with => “‘tag_last_id=’+#{last_activity.to_i}+’&tag_name=’+’#{tag}’”

THIS ONE IF the values of _district_id and _state_id are INTEGER

THIS ONE IF the values of _district_id and _state_id are STRING

And if that doesn’t work it would be coz $(‘element_id’).value DIDN’T WORK.

so just replace it with document.getElementById(‘element_id’).value and it should be working then.

Good luck,

Thank you Nitin....Thank you Bala....
I got it worked.....
Thank you sooooo much. This was a new learning for me...