title: Javascript Rails JSON Problem
body: <p>I have a large json from my rails controller:</p>
  
  <pre><code>@json = {:Nodes =&gt; @nodes.as_json(:only =&gt; [:ID, :Lat, :Lon])}
  </code></pre>
  
  <p>and I want to use it in my javascript in my views. In a larger scope, I want to use the json to retrieve lat and lon's to plot on a Google Map. However, right now, I'm just trying to see if I can get all the points properly. My question is:</p>
  
  <p>What's a good way to parse the json in the javascript file? (Note: the file's extension is still html.erb) I've tried:</p>
  
  <pre><code>var stuff = eval('(' + &lt;%= @json %&gt; + ')'); 
  </code></pre>
  
  <p>but that doesn't seem to be working. Can anyone help? Thanks so much!</p>