Configuring generator to generate .scss file instead of css
I'm currently p开发者_C百科laying with Rails 3.1 RC4, and when I try to generate a scaffold:
rails generate scaffold animal
I notice that it creates a CSS file in:
app/assets/stylesheets/animals.css
I was expecting it to generate an animals.scss
instead.
Am I missing something?
PS: I got Haml to generate correctly following the instruction from here.
On May 24, 2011, SCSS generators were moved out from Rails, and put into Sass Railtie.
See this commit.
This means in your application, you need to include sass-rails
gem in your Gemfile to get the generator working correctly. In other words, it's not enough to simply include sass
gem to get the generator working.
When SCSS is finally generated, your stylesheet will look something like mystylesheet.css.scss
.
By default, SCSS is used.
精彩评论