score:2

Accepted answer

The first parameter of $.getJSON() must be a URL (http://api.jquery.com/jQuery.getJSON/). So, you can start by putting here a URL that responds to a GET request with an array, or removing this ajax call, and put directly the result of <%= @yearly_complaints.to_json.html_safe %> into a javascript variable (would be in data here).


Related Articles