CSS-preprocessors are amazing, anyone denying that hasn't dealt with servers or hasn't written enough css. For example, when dealing with multiple applications with different code bases being routed by a reverse proxy server you may found yourself being limited by sass-rails's asset helpers, as the path generated inside your css files do not reflect the same dynamism as the ones in your markup.
SASS comes with a bunch of nifty things out of the box, one of them are functions. You can declare your customized functions in an initializer and pass Ruby specific logic into your CSS, how cool is that?
For instance, if for whatever reason we want to create a different asset path for our images depending on the environment we are in, we can do so implementing a SASS function.
Then you can use this function in your SCSS in whatever way you see fit, for instance:
@if environment() == "staging"
@else if environment() == "production"