I'm building a weight loss app that tracks a user's weight and how many calories they've eaten each day. I'm using Highcharts to display this information, with each chart saved in either calories.js or weights.js. The calorie chart displays fine, but I've run into a problem displaying the weights chart. It only displays if I also display the calories chart on the same page.
The only change I make is in the view, where I add the calorie chart's div code - no changing of the model, controller, or javascript. Somehow that fixes the weight chart.
If I rename weights.js to something that comes before calories.js alphabetically - aweights.js - then the problem is reversed, and I can't get the calories chart to display without the weights chart. Calories.js and weights.js always load, according to the Rails console.
What's going on here?
Edit: Backbone.js - Coffeescript extends says that ROR does import assets alphabetically, so this isn't too crazy.