title: Dynamic CSS using Sprockets
body: <p>I'm working on a site builder in rails and I would like to render the sites css using Sprockets SCSS processors. Since the user can change colors and logos, I can't use Sprockets precompilation so I've started working on a Rails SCSS template handler to handle dynamic views. </p>
  
  <p>The goal is to compile 'app/views/sites/show.css.scss' any time /sites/43543.css is requested.  Here's what I have so far. You'll notice I first run the template through the ERB processor and then attempt to run it through Sprockets. </p>
  
  <p><a href="https://gist.github.com/3870095" rel="nofollow">https://gist.github.com/3870095</a></p>
  
  <p>Manuel Meurer came up with an alternative solution that writes the ERB output to a path and then triggers the Asset Pipeline to compile it. I was able to get his solution to work locally but it wont work on heroku because the asset path is not writable. Files can only be written to the tmp directory and those files are only guaranteed for a single request. </p>
  
  <p><a href="http://www.krautcomputing.com/blog/2012/03/27/how-to-compile-custom-sass-stylesheets-dynamically-during-runtime/" rel="nofollow">http://www.krautcomputing.com/blog/2012/03/27/how-to-compile-custom-sass-stylesheets-dynamically-during-runtime/</a></p>