【问题标题】:rails not identifying haml - rails 2.3.8rails没有识别haml - rails 2.3.8
【发布时间】:2011-07-03 19:01:08
【问题描述】:

我有一个在 ruby​​ 上运行的 Rails 2.3.8 项目(ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]),

我在 app/views 中有一个名为 uploads 的文件夹,它有 haml 文件

_files.html.haml

但是当我尝试使用

调用它时
<%= render :partial =>  "/uploads/files"%>

是说

Missing template /uploads/_users.erb in view path app/views:vendor/plugins/devise-1.0.8/app/views

它似乎试图找到 .erb (_users.erb),其中文件名为 _users.html.haml

我该如何解决这个问题,任何帮助都会非常感谢

干杯

同人

【问题讨论】:

  • 顺便说一句,我尝试添加 Hi All 作为问候语,但它不起作用,

标签: ruby-on-rails haml partial


【解决方案1】:

您的 gemfile 中是否列出了 haml gem?我相信这就是所有需要做的。

【讨论】:

  • 是的,就是这样,我将 config.gem "haml" 添加到 environment.rb 中,现在它的工作非常感谢
  • 很高兴为您提供帮助。另外,看起来这是重复的,请参阅stackoverflow.com/questions/6399780/…
  • 今天兼容的版本好像是haml 3.1.8
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多