Let me add a solution that worked for me.
As mentioned in the previous answer, you can remove
*= require_tree .
from application.css file.
I saved
*= require_self
for general styles in the app.
Then, in my application.html file, I used the following operators to include only application.css and controller.controller_name.css stylesheets in the view.
= stylesheet_link_tag "application", controller.controller_name = javascript_include_tag "application", controller.controller_name
As you can see the same works for JavaScript files.
Elyasin
source share