I decided to use Sass @importinstead of Sprocket *=require.
I have this in application.scss :
@import 'normalize';
@import 'font-awesome';
@import 'variables';
and this is in blog.scss :
@import 'application';
Thus, I have separate stylesheets for individual controllers (makes my code more organized).
To make this work, I also added stylesheet_link_tag params[:controller]to my layout, then added a line Rails.application.config.assets.precompile += %w( blog.css )to the /config/initializers/assets.rb file and restarted the server.
Is there a drawback to this approach? Will turbines be slower?
source
share