设计生成器使用 erb 而不是 haml

发布于 12-17 08:40 字数 247 浏览 2 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

油焖大侠2024-12-24 08:40:32

不可能直接生成它们。不过,有一个简短的教程 如何使用 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.

嘿咻2024-12-24 08:40:32

这意味着 Devise 没有 HAML 模板。然而,就像 @halfdan 所说,使用 html2haml 进行转换非常容易......

That means that Devise doesn't have templates for HAML. However like @halfdan said it's pretty easy to convert with html2haml...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文