title: How to create a json from a hash using jBuilder in Rails?
body: <p>I have a hash in this format. </p>
  
  <p>@company_details = {org_id1 => [employee1, employee2, employee3, employee4], org_id2 => [employee1, employee2, employee3, employee4] ... }</p>
  
  <p>I want something like: </p>
  
  <pre><code>[
      {
          "org_id": "1234",
          "employees": [
              {
                  "employee_id": 1,
                  "company": "Pepsi",
              },  
              {
                      "employee_id": 2,
                      "company": "Coke",
              },
              {
                  "employee_id": 3,
                  "company": "Dr. Pepper",
              }
          ]
      },
      {
          "org_id": "3433",
          "employees": [
              {
                  "employee_id": 5,
                  "company": "Mirinda",
              },  
              {
                      "employee_id": 8,
                      "company": "7up",
              },
              {
                  "employee_id": 13,
                  "company": "Hersheys",
              }
          ]
      }
  ]
  </code></pre>
  
  <p>I tried something like </p>
  
  <pre><code>//index.json.jbuilder
  @company_details.each do |key,value|
    json.org_id key
    json.employees value
  end
  </code></pre>
  
  <p>How to customize the value so only some attributes get displayed?</p>