views:

379

answers:

2

Maybe I'm confused on how SASS/SCSS works within Rails (2.3.8.) but I was under the impression that if I included the option

Sass::Plugin.options[:always_update] = true

that whenever I changed my SCSS file and then hit the page (controller) again, the SCSS would recompile.

I can't seem to get this to work, and can't seem to find a good tutorial / example for it. I've tried setting the above property in the Environment.rb file, but it didn't seem to do anything. I tried putting it in its own initializer with require 'sass' but that doesn't seem to work either.

What am I missing? Or am i just forced to keep a terminal open with a sass --watch command running to be able to rapidly debug / change my styles?

thx

A: 

Make sure you run compass init in your rails project. It will set up the following:

  • config/compass.rb
  • config/initializers/compass.rb
Andrew Vit
I ended up going a completely different direction in the end. (using Less instead of SASS, per a friend of mine's suggestion) However, if someone else knows the above is true or has tested it out, post a comment and I'll mark this one as the Answer for posterity and google searches. :)Thanks Andrew!
Vulgrin
Bleah. Less? :) http://twitter.com/andrewvit/status/16658272493
Andrew Vit
A: 

You should reload a normal View of a Controller instead of just the stylesheet directly.

btw, as the documentation says :always_update updates the css files on every controller reload:

Whether the CSS files should be updated every time a controller is accessed, as opposed to only when the template has been modified. Defaults to false. Only has meaning within Rack, Ruby on Rails, or Merb.

KARASZI István