I have object nav in my rails application. But the nav obj will have another nav obj.
My question is, how can i output or render json like this that nav have another sub nav and may have unlimited depth? Many thanks!!!
"nav": [
{
"id": 1,
"name": "Home",
"icon": "home",
"nav": [{ id: 2,
name: "game"
icon: 'game'
etc.......
}],
jbuider is the solution for complex json.
Check the great tutorials for complex json (jbuider) -
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.