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
{"page":"1","total":2,"records":"13","rows":[{"id":"13","cell":["13","2007-10-06","Client
3","1000.00","0.00","1000.00",null]},{"id":"12","cell":["12","2007-10-06","Client
2","700.00","140.00","840.00",null]}
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
Arshak
-- 
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---