In most of the tutorials I have seen, whenever there is a requirement of add raw prototype code, the author uses application.js file. But in a huge application,writing the js code for the whole app in single file doesn’t make sense. So what is the right way of doing it? Is it possible to write js code in different files and add it to my template based on my action?
Share
Of course, you can create a js file for each of your view. And include them appropriately.
application.js should only contains general purpose javascript function.