By default, (at least, using scaffolding), Rails adds links to all stylesheets in the /app/assets/stylesheets directory. I’d like to have multiple smaller stylesheets for organization, but only need to link to one that imports the rest in order to stay organized yet minimize HTTP requests.
Is there a way to disable this auto-inclusion, whether by configuring the asset pipeline or changing how they’re included in the layout itself?
FWIW, I’m including the main stylesheet from application.html.haml using stylesheet_link_tag "application".
You can do this by modifying your application.css(.scss) file.
In that file there will be the following line:
Simply remove that and replace it with the includes you require.
application.css
Then you can have another file
main.css
And include them separately:
The stylesheet_link_tag can take an array too, if for some reason you want the css files to load in the same place, but with separate HTTP requests.
The files with the requires are called manifest files.