title: Undefined local variable or method `parsedData' when Using JSON to Parse data from Googlesheets To FusionCharts in Ruby on Rails app
body: <p>Im loading Data from <code>Googlesheets</code> to <code>fusioncharts</code> in my rails app.</p>
  
  <p>I use <code>Jquery</code> to Fetch the data from the google sheets as seen in this tutorial <a href="https://www.sitepoint.com/interactive-javascript-charts-using-data-from-google-sheets/" rel="noreferrer">https://www.sitepoint.com/interactive-javascript-charts-using-data-from-google-sheets/</a></p>
  
  <p>Rails always gives me this error <code>undefined local variable or method 'parsedData' for #&lt;GreetingsController:0x007fdb862e9cf8&gt;</code> when I try to fetch the data from the <code>pasedData</code>variable like this.</p>
  
  <p><code>data: parsedData</code> </p>
  
  <p>I'm not sure on what I'm doing wrong here, this is the first time I'm using JSON to load data to fusioncharts in rails app. Any help would be much appreciated </p>
  
  <p>here is the Jquery snippet were the googlesheets gets turned into JSON.</p>
  
  <pre><code>var spreadsheetId = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    url = "https://spreadsheets.google.com/feeds/list/" +
    spreadsheetId +
    "/od6/public/basic?alt=json";
  
  $.get({
    url: url,
    success: function(response) {
      var data = response.feed.entry,
        len = data.length,
        i = 0,
        parsedData = [];
  
      for (i = 0; i &lt; len; i++) {
        parsedData.push({
          label: data[i].title.$t,
          value: data[i].content.$t.replace('income: ', '')
        });
      }
  
    }
  });
  </code></pre>
  
  <p>Here is the fusionchart snippet from the  rails controller</p>
  
  <pre><code>     @chart2 = Fusioncharts::Chart.new({    
  
       type: 'bar2d',
        renderAt: 'chart-container',
        width: '100%',
        height: '300',
        dataFormat: 'json',
        dataSource: {
          chart: {
           caption: "Highest Paid Actors",
           yAxisName: "Annual Income (in milion USD)",
           numberPrefix: "$",
           theme: "fint",
          exportEnabled: "1",
          },
  
             data: parsedData 
      }
  })
  </code></pre>
  
  <p>and here is instructions about  rails and fusioncharts <a href="https://github.com/fusioncharts/rails-wrapper" rel="noreferrer">https://github.com/fusioncharts/rails-wrapper</a></p>