I am trying to use the jQuery plugin jQCloud to create word clouds in a rails application.
The word cloud data needs to be in a format:
var word_array = [
{text: "Lorem", weight: 15},
{text: "Ipsum", weight: 9},
];
I currently have a ruby hash of word frequencies like:
{"people"=>111, "other"=>110}
How can I convert this into the required named javascript array, like:
[{text: "people", weight: 11},{text: "other", weight: 11}]
Any ideas or suggestions would be greatly appreciated!
Thanks