Accepted answer

the first parameter of $.getjson() must be a url ( 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 Query

More Query from same tag