Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting SASS to generate CSS files from multiple directories
    text
    copied!<p>Fairly new to Rails. I am implementing a wholesale homepage redesign on a Rails site. For the time being, we will push the redesigned home page but leave the rest of the site as is. Later, we will port the rest of the site to the new design.</p> <p>I would like to create a "branch" of the CSS inside the current project that is loaded only by the home page. We use SASS to generate the CSS. The file layout:</p> <pre><code>/public/stylesheets: #Generated CSS for rest of site /public/stylesheets/sass: #SASS source files for rest of site /public/stylesheets/v3: #Desired location for CSS for home page /public/stylesheets/v3/sass: #SASS source files for new-style home page </code></pre> <p>The controller for <code>/</code> calls <code>render :layout =&gt; 'v3'</code>, and this layout contains:</p> <pre><code>!= include_stylesheets :common_v3, :media =&gt; "all" </code></pre> <p>Here's the relevant section from assets.yml:</p> <pre><code>stylesheets: common: - public/stylesheets/reset.css - public/stylesheets/*.css common_v3: - public/stylesheets/v3/reset.css - public/stylesheets/v3/*.css </code></pre> <p>Could someone help me figure out how to make SASS generate the new CSS files? If I put a new file in <code>/public/stylesheets/sass</code>, the corresponding CSS file is created, but the v3 dir is ignored. </p> <p>I tried the following in environment.rb, but it's not working.</p> <pre><code>Sass::Plugin.options[:template_location] = %W( #{RAILS_ROOT}/public/stylesheets/sass #{RAILS_ROOT}/public/stylesheets/v3/sass ) </code></pre> <p>Using Rails 2.3.8 with Haml 2.2.2.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload