I am fetching the JSON using the library philsturgeon/codeigniter-restserver When I check in the response section of console, I get the proper JSON values returned like
this: [{name:test,address:test},{name:test2,address:test2}].
On fronted I want these values to be displayed in the template. But it just returns {"readyState":1}
when I do <%= JSON.stringify(ledgers) %>
.
I call the template from my view like this:
$("#container-left").html(this.template({ledgers:app.ledgers.fetch()}));
My REST controller function looks like:
public function index_get()
{
$this->response($this->db->get('ledgers')->result());
}