When I use script tags in my index.html.erb the exact code runs fine but when I put the code in index.js.erb, I get the error:
Uncaught Rickshaw.Graph needs a reference to an element
I tried precompileing assets, really don't know what else to try...
also here is my application.js
//= require rickshaw_with_d3
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
I did also try putting rickshaw on the bottom. Don't yet understand in what order things are loaded in rails, any ideas?