title: Converting "complex" JSON data in to a hash
body: <p>I am using Ruby on Rails 3 and I am trying to convert the following JSON data </p>
  
  <pre><code>"{\"errors\":{\"base\":\"Invalid field.\"}}"
  </code></pre>
  
  <p>in to a hash accessible this way:</p>
  
  <pre><code>@internal_test1[:errors][:base]
  # =&gt; "Invalid field"
  </code></pre>
  
  <p><strong>How to do that?</strong></p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>@internal_test1 = "{\"errors\":{\"base\":\"Invalid email/password combination.\"}}"
  test = ActiveSupport::JSON.decode(@internal_test1)
  @internal_test2 = test["errors"]
  </code></pre>
  
  <p>The debug is</p>
  
  <pre><code>@internal_test1
  --- "{\"errors\":{\"base\":\"Invalid email/password combination.\"}}"
  
  @internal_test2
  --- 
  base: Invalid email/password combination.
  </code></pre>