You also need to consider that in a pre-compiled asset scenario, the CSS will be run through Sprockets during compilation, so you'd end up with a static colour (assuming @school
was actually instantiated which it wouldn't be). This is undesirable as every school would then have the same colour (whatever that happened to be during compilation stage).
For custom branding like this we let our users specify their colours, and include a block of CSS in the layout:
:css
h1.logo {
color: <%= @school.primary_color %>;
}
It isn't ideal, but if you have a small number of customisations seems to work fairly well.