I am using rails and I have lot of javascript functions,I don’t want to put them in application.js. Is it fine to move them to different js files based on the layouts ? so that the each time when I load, it will not load all of them. is there any other best practice is available for these kind of issues.
Share
In general we follow the following rule,
Talking in terms of performance, in rails 3.1 we have asset pipeline that compresses and packages js files. Prior to that we have many tools available that compresses and packages the js files. Example asset packager