title: How to parse JSON to display in a Rails View?
body: <p>I'm just trying to do a quick currency conversion using the Google API and display just the "rate" information in a rails view using either jQuery or a Rails method. </p>
  
  <p>The returned JSON is in this format:</p>
  
  <pre><code>{"to": "EUR", "rate": 0.74928817599999997, "from": "USD"}
  </code></pre>
  
  <p>So far I have tried a jQuery Ajax request as follows:</p>
  
  <pre><code>$(document).ready(function(){
  $.getJSON('http://rate-exchange.appspot.com/currency?from=USD&amp;to=EUR', function(data) {
    var items = [];
  
    $.each(data, function(key, val) {
      items.push('&lt;li id="' + key + '"&gt;' + val + '&lt;/li&gt;');
    });
  
    $('&lt;ul/&gt;', {
      'class': 'my-new-list',
      html: items.join('')
    }).appendTo('#exchange');
  });
  });
  </code></pre>
  
  <p>I don't actually need the items array or the unordered list. I have just copied most of this from the jQuery documentation to ensure it should be working. </p>
  
  <p>I would appreciate any help with this code or if there is a better Rails-way to implement the same thing. </p>