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) –
1) jbuider Asciicast
2) jbuider customized Json