I was wondering how to add another key value pair to the end of the JSON generated by DataMappers .to_json
method. When I try to call to_json(:methods => [:total_pages])
, it ignores the methods bit all together.
I would like it to produce something like this:
{
'data': [rows go here],
'total_pages': X
}
Is there a way to just do the method inline or something?
Thanks!