设计生成器使用 erb 而不是 haml
我正在尝试使用 devise 生成 haml 视图,但它总是使用 erb 代替。我正在运行 Rails 3.1 &红宝石 1.9.2。 Rails 生成器(如脚手架)生成 haml。我尝试设置模板引擎:
config.generators do |g|
g.template_engine :haml
end
但仍然不起作用。如果您有想法,我们非常欢迎。
感谢您的宝贵时间!
I'm trying to generate haml views with devise, but it always use erb instead. I'm running rails 3.1 & ruby 1.9.2. Rails generators (like scaffold) generates haml. I tried setting the template engine :
config.generators do |g|
g.template_engine :haml
end
But still doesn't work. If you have an idea, it is most welcomed.
Thanks for your time !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

不可能直接生成它们。不过,有一个简短的教程 如何使用
html2haml
和简单的 bash 脚本将 erb 视图从 devise 转换为 haml 布局。It's not possible to generate them out of the box. However, there is a short tutorial on how to convert the erb views from devise to haml layout using
html2haml
and a simple bash script.