How do I combine two methods into one json formatted variable?
- by JZ
I'm storing JSON formatted data into a var adds with the following methods:
var adds = <%= raw @add.to_a.to_json %>;
var adds = <%= raw @add.nearbys(1).to_json %>;
The first line of code stores the location of an individual in JSON format, the second line of code searches for that person's neighbors, within a 1 mile range. How do I…