On Tuesday 05 May 2009, mrbless wrote: > In my controller I have found all the movies like this > @budgets=Budget.find(:all).to_json
If it's ok to issue a separate request for the data, have a look at http://github.com/mschuerig/ruby_template_handler One way or another, you'll have to do the conversion to the specific format you need yourself. Michael > Now in the view file what i want to do is something like this > <script> > var datasets = { > "usa": { > label: "USA", > data: [[1988, 483994], [1989, 479060], [1990, 457648], > [1991, 401949], [1992, 424705], [1993, 402375], [1994, 377867], > [1995, 357382], [1996, 337946], [1997, 336185], [1998, 328611], > [1999, 329421], [2000, 342172], [2001, 344932], [2002, 387303], > [2003, 440813], [2004, 480451], [2005, 504638], [2006, 528692]] > }, > "russia": { > label: "Russia", > data: [[1988, 218000], [1989, 203000], [1990, 171000], > [1992, 42500], [1993, 37600], [1994, 36600], [1995, 21700], [1996, > 19200], [1997, 21300], [1998, 13600], [1999, 14000], [2000, 19100], > [2001, 21300], [2002, 23600], [2003, 25100], [2004, 26100], [2005, > 31100], [2006, 34700]] > } > } > </script> -- Michael Schuerig mailto:[email protected] http://www.schuerig.de/michael/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

