0

My controller queries the database and organizes some values. I need to pass these values to javascript(JQuery) which use the values to fullfill UI features. How to pass values from controller to javascript???

1
  • Have you tried to do it via Ajax and JSON? Commented Feb 9, 2011 at 11:45

1 Answer 1

2
  1. Pass data through your view.
  2. Use Ajax. Then pass all you need from respond_to block, or through rjs file
  3. Organize Comet server. And push javascript right from your controllers. (for example, http://juggernaut.rubyforge.org/)
Sign up to request clarification or add additional context in comments.

Comments

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.