title: what is the hash structure to produce json?
body: <p>Below is a sample of final json I pass to javascript. I will use the (<a href="https://github.com/brianmario/yajl-ruby" rel="nofollow">yajl</a>) ruby library to create this json from a hash.</p>
  
  <p>The question is what should a <strong>ruby hash</strong> that produces the json below look like?</p>
  
  <pre><code>var data = [{
         data: "basics",
         attr: {},
          children: [
           {data: "login", attr: {run: "run"},
             children: [                   
             {data: "login", attr: {}}
            ]
           } ,
           {data: "Academic Year", attr: {run: "run"},
            children: [                   
             {data: "login", attr: {}},
             {data: "Academic Year", attr: {filter: "mini", SOF: "yes"}}
            ]
  
           }
          ]
        }];
  </code></pre>