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.
Asked
Active
Viewed 155 times
1 Answers
1
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

Manuel van Rijn
- 10,170
- 1
- 29
- 52
-
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 – ramya Oct 18 '11 at 09:25
-
see the example in my answer :) – Manuel van Rijn Oct 18 '11 at 10:46
-
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 http://stackoverflow.com/questions/7817382/rjs-error-object-doesnt-support-this-property-on-element-update – ramya Oct 19 '11 at 09:54