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 Answer
- Pass data through your view.
- Use Ajax. Then pass all you need from respond_to block, or through rjs file
- Organize Comet server. And push javascript right from your controllers. (for example, http://juggernaut.rubyforge.org/)