Using Cassette with Spark View Engine
Namely—because I’ve never tried to use anything that returned void before. Helpers tend to always return either Html or a value.
I finally stumbled on a section in the Spark View Engine documentation for inline expressions.
Sometimes, when push comes to shove, you have a situation where you’re not writing output and there isn’t a markup construct for what you want to do. As a last resort you can produce code directly in-place in the generated class.
Well then, that sounds like what I want.
So our void methods, the Html.ReferenceScript and Html.ReferenceStylesheet should be written as:
Note the # (pound sign) and the semi-colon at the end of the statement block.
Our rendering scripts; however, use standard Spark output syntax:
Now my Spark view contains the hashed Urls–in order–as it should.