views:

100

answers:

2

How do I reference a .sass file from a .haml file?

I have the following haml expression that will reference a .css file:

%link{'href' => '/stylesheets/layout.css?cache=1', 'rel' => 'stylesheet', 'type' => 'text/css'}/

How do I reference a .sass file?

+5  A: 

Sass files compile to CSS files. If you're using Rails, this is done automatically; otherwise, you can use the sass command-line executable. Check out the Sass documentation for more information.

Once you've compiled your Sass files to CSS, you reference the CSS file just like you normally do.

nex3
I am having to use the command line executable. Rails is not automatically compiling it. Is there anything I have to do to tell rails it has sass files?
dagda1
Make sure you've got the plugin installed or you're loading it from the gem by adding `config.gem "haml"` to your configuration.
nex3
A: 

try using the stylesheet_link_tag method

stylesheet_link_tag "layout"
fernyb