Why do we have to require the JS files inside application.js in rails?

Viewed 3327

I am new to rails so pardon the question. Now, why do we have to require the JS files inside the application.js file or the css files inside the application.css file? As far as I have read that when we launch the server rails loads all the javascript and css files from the directory into one file, so if it already loads all the files from the directory why there is a need to write inside the application.js or application.css file?

For example:

//= require abc
//= require xyz

If I already have abc.js and xyz.js file, why should I require them inside application.js file?

1 Answers
Related