title: Rendering a hash in a Rails View
body: <p>I have a hash like this</p>
  
  <pre><code>valuehash={:a =&gt; { "test1"=&gt;"testing1"} , :b =&gt; {"test2" =&gt; "testing2"}}
  </code></pre>
  
  <p>I want my response as below</p>
  
  <pre><code>value : [ { "test1" :"testing1"} ,
          {"test2" : "testing2"}]
  </code></pre>
  
  <p>I have tried below code in my View but it doesn't seem to work</p>
  
  <pre><code>json.value do
    json.child! do
      json.template! valuehash[:a]
    end
    json.child! do
      json.template! valuehash[:b]
    end
  end 
  </code></pre>
  
  <p>Can any one tell me what is the problem with my code .Also to need I need to do some modification to value hash based on some conditions so I don't want to use map,select but want to use something like above to render.</p>