load javascript and css only when needed RAILS -
I am learning Ruby on Rail and Javascript Is there any way to load JS file only by the Railways? I tried to make simple application, but when I check on logs, I know that it always loads JS, even unnecessary libraries.
I already searched it and found that it is using configurations to load specific JS only for specific pages. It's good, but I think that when we have a library Work that is used by many pages, it is difficult to maintain whether someone can give good advice?
Thanks
requireJS :
RequireJS is a javascript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments such as rhino and node. Using modular script loader like RequireJS will improve the speed and quality of your code.
Comments
Post a Comment