JSON nesting

I'm trying to return JSON from a controller method with a certain type
of nesting to satisfy the requirements of a javascript UI component:

This is what I want the JSON to look like


Here is my code but id is showing up at the same level of page and total
rather than being inside of rows (and at the same level as cell)

render :json => {:page => page, :total => total_pages, :records =>
records, :rows => {:id => @account_activities.id, :cell =>
@account_activities} }.to_json