title: Passing data from db into Highcharts in Rails 3.x
body: <p>I'm a rails noob, and trying to figure out how to graph some data in a  database using high charts. I have the following code for the chart:</p>
  
  <pre><code>    &lt;script type="text/javascript" charset="utf-8"&gt;
              $(function() {
                  new Highcharts.Chart({
                      chart: {
                          renderTo: "pdd_graph"
                      },
                      title: {
                          text: "Percent Depth Dose"
                      },
                      xAxis: {
                          type: "datetime"
                      },
                      yAxis: {
                          max: 1.4,
                          min: 1.2,
                          title: {
                              text: "measmt"
                          }               
                      },
                      series: [{
                          pointStart: &lt;%= 12.months.ago.to_i * 1000 %&gt;,
                          data: &lt;%= (12.months.ago.to_date..Date.today).map { |test_date| @pdd.field_5x5 } %&gt;,
                          name: '5cm X 5cm Field'             
                      }]
  
                  });
              });
  
          &lt;/script&gt;
  </code></pre>
  
  <p>I want to graph the columns test_date and field_5x5 from a table called pdd . I'm just having a hard time with the proper syntax. Any help would be appreciated.</p>
  
  <p>Thanks.</p>