Having trouble just getting the Highchart to show

前端 未结 3 745
刺人心
刺人心 2021-01-18 21:33

I\'m pretty new to Javascript, Rails and JQuery all working together.

I\'m going through this tutorial (http://www.highcharts.com/documentation/how-to-use#installati

3条回答
  •  爱一瞬间的悲伤
    2021-01-18 21:54

    As we discussed in chat, there were a few missing pieces.

    • You needed a local copy of the Highcharts library
    • You needed to reference your script that calls the library from the correct place.

    So, in short, you needed this in your layout:

     
     
     
    

    Now going forward (assuming you are working w/ rails 3.1+), I'd suggest moving your javascripts to a more conventional location. In 3.1, rails likes to see it in app/assets/javascripts but public/javascripts is still fine, just not exactly conventional.

    You will get a lot of milage by understanding the rails helpers to insert script tags and the Asset Pipeline.

    Good luck!

提交回复
热议问题