配置生成器生成 .scss 文件而不是 css
我目前正在使用 Rails 3.1 RC4,当我尝试生成脚手架时:
rails generate scaffold animal
我注意到它在以下位置创建了一个 CSS 文件:
app/assets/stylesheets/animals.css
我希望它生成一个 animals.scss
。
我错过了什么吗?
PS:我按照 此处。
I'm currently playing 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
2011年5月24日,SCSS生成器从Rails中移出,并放入Sass Railtie中。
请参阅此提交。
这意味着在您的应用程序中,您需要在 Gemfile 中包含
sass-rails
gem 才能使生成器正常工作。换句话说,仅仅包含sass
gem 来让生成器工作是不够的。最终生成 SCSS 后,您的样式表将类似于
mystylesheet.css.scss
。默认情况下,使用 SCSS。
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 includesass
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.