controller:
def get_nodes
...
render :text => nodes.to_json.to_s
end
which renders valid JSON ( Its picked up and parsed by my chrome plugin )
I'm using this in my JS:
var nodes = $.get('http://localhost:3000/users/get_nodes/4fb2739045a86e0c5c000002');
console.log(nodes);
console.log output: https://i.sstatic.net/2l7pX.png
I'm able to get the data successfully however all I want is the 'responseText' saved into the 'nodes' variable.
I've managed to isolate it to this code by replacing this dynamic var with a static one ( in that case it behaves as expected )