title: Create Nested JSON in Rails Controller
body: <p>I am trying to create a nested JSON that has data from various db tables and return it using 
  format.json {render json: @Model} </p>
  
  <p>For example a json structure like this:</p>
  
  <pre><code>{"Model1": [
          {"id": 3, "name": "newURI", {"Model2": ["id": 4, "name":"vill"]}},
          {"id": 1, "name": "bill", {"Model2": ["id": 1, "name":"lily"]}},
          {"id": 2, "name": "ton", {"Model2": ["id": 2, "name":"bow"]}},
      ]}
  </code></pre>
  
  <p>I have searched around, but wasn't too successful. I saw Rabl, but the nested JSON generated is not well formed. Please help me if you can. Thanks</p>