在Rails中生成Sass和Haml [英] Generating Sass and Haml in Rails

查看:71
本文介绍了在Rails中生成Sass和Haml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前的Rails头不带有haml生成器吗? (我知道在Rails 2中必须添加一个生成器插件.)设置config.generators.template_engine =:haml不起作用.另外,如何从生成.scss切换到生成.sass?设置config.generators.template_engine =:sass无效.我收到错误haml/sass [找不到].我已经安装了我的Gemfile,并且在我的Gemfile中.

Does the current head of Rails not come with haml generators? (I know in Rails 2 you had to add a generator plugin.) Setting config.generators.template_engine = :haml doesn't work. Also, how do I switch from generating .scss to generating .sass? Setting config.generators.template_engine = :sass didn't work. I get error haml/sass [not found]. I have both installed and in my Gemfile.

推荐答案

在3.0中,没有haml或sass/scss支持,您需要将它们放在gemfile中,然后调用bundler.但是,即使有了这些宝石,您也不会得到任何生成器.如果您确实想要的话,应该在泰斯语中使用一些东西.

In 3.0, there is no haml nor sass/scss support, you need to place them in your gemfile, and call bundler. But you will get no generators even with these gems, you should use something with theese if you realy want that.

在Rails 3.1中,sass/scss是框架的一部分.

And with rails 3.1, sass/scss is part of the framework.

这篇关于在Rails中生成Sass和Haml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆