=> [#<Budget id: 1, country: "usa", year: "2000", amount: 15000>,
#<Budget id: 2
, country: "usa", year: "2001", amount: 1564>, #<Budget id: 3,
country: "usa", y
ear: "2002", amount: 6463>, #<Budget id: 4, country: "usa", year:
"2003", amount
: 150002>, #<Budget id: 5, country: "usa", year: "2004", amount:
5000>, #<Budget
id: 6, country: "usa", year: "2005", amount: 4150>, #<Budget id: 7,
country: "u
sa", year: "2006", amount: 100>, #<Budget id: 8, country: "germany",
year: "2000
", amount: 1000>, #<Budget id: 9, country: "germany", year: "2001",
amount: 1526
4>, #<Budget id: 10, country: "germany", year: "2002", amount: 64633>,
#<Budget
id: 11, country: "germany", year: "2003", amount: 1502>, #<Budget id:
12, countr
y: "germany", year: "2004", amount: 500>, #<Budget id: 13, country:
"germany", y
ear: "2005", amount: 450>, #<Budget id: 14, country: "germany", year:
"2006", am
ount: 10>, #<Budget id: 15, country: "britian", year: "2000", amount:
150>, #<Bu
dget id: 16, country: "britian", year: "2001", amount: 15064>,
#<Budget id: 17,
country: "britian", year: "2002", amount: 663>, #<Budget id: 18,
country: "briti
an", year: "2003", amount: 2002>, #<Budget id: 19, country: "britian",
year: "20
04", amount: 50000>, #<Budget id: 20, country: "britian", year:
"2005", amount:
4150>, #<Budget id: 21, country: "britian", year: "2006", amount:
1000>]
On May 5, 4:49 pm, 7stud -- <[email protected]> wrote:
> mrbless wrote:
> > In my controller I have found all the movies like this
> > @budgets=Budget.find(:all).to_json
>
> > 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>
>
> What is the output if you write:
>
> p @bugets
>
> in the controller?
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---