0

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 1

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

Sign up to request clarification or add additional context in comments.

3 Comments

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
see the example in my answer :)
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/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.