I have to load JS files in order in a rails view. In the rails view I have:
<%= javascript_include_tag "diagrams" %>
The diagrams.js manifest file have the required JS files in the order that is needed:
//= require diagramtool/kinetic
//= require diagramtool/diagramtool0
//= require diagramtool/diagramtool1
//= require diagramtool/diagramtool2
But they are not load in the order specified in the diagrams.js file.
I already have removed the require_tree .
in the application.js file.
What do I have to do to load the JS files in a specific order?
Edit1: Every time I click in the view I get different results (it seems random):
I don't really understand what is going on here!! Is that difficult in Rails to load JS files in order? I have read some things about the asset pipeline and I don't understand this random behaviour. If I refresh the page always works, the files are always loaded in order. Any help?
Edit2:
The view source is like this: