I have a ruby on rails application.I am using jquery to populate a drop down list box. I have to get the values from the sql query. i.e selected_release=Release.find(id) cycles=selected_release.cycles. The second drop down is populated from cycles.
1 Answer
I wouldn't create a sql like query within jQuery if I was you.
How about creating a onchange event on the first dropdown, which wil post the Id of the Release to an action, which renders the cycles dropdown?
see this link for an example
3 Comments
ramya
Hi thanks a lot for your suggestion.Could you please explain me like how to populate the drop down with the results that i got in the controller using jquery
Manuel van Rijn
see the example in my answer :)
ramya
Hi Manuel,Thanks a lot for ur help.I went through the example.I am getting the following error "RJS error.Object doesn't support this property or method.I have posted the question stackoverflow.com/questions/7817382/…