To indicate rails about additional files that you want to precompile, you can add them to config.assets.precompile .
config.assets.precompile += ["other_application.css"]
You only see application.css in your HTML, because the only file you include
<%= stylesheet_link_tag "application" %>
If you have custom.css.scss in your apps/assets/stylesheets directory, it will compile just like application.css .
For example, I may have
- _common.css.scss - application.css.erb.scss - other_application.css.erb.scss
in app/assets/stylesheets . At the top of the non-partial files I will put
@import "common";
enable _common.css.scss . Now I can refer to either a stylesheet that is independent of each other in the layout.
<%= stylesheet_link_tag "application" %> # or <%= stylesheet_link_tag "other_application" %>
deefour
source share