Rails 消息:ActionView::MissingTemplate [英] Rails message: ActionView::MissingTemplate
问题描述
我收到一个我无法弄清楚的错误:
I am getting an error that I cannot figure out:
ActionView::MissingTemplate (Missing template cluster/delete_stuff.erb in view path app/views)
<...snip trace...>
Rendering rescues/layout (internal_server_error)
我正在增强"其他人的代码并遵循他们建立的约定,他们的代码如下:
I am "enhancing" others code and am following the convention they set up, where they have have code like:
<%= render :partial => "other_stuff" %>
还有一个名为 _other_stuff.html.erb 的文件,一切正常,但是当我复制这些小片段时,出现上述错误.有任何想法吗?这里发生了一些事情,我需要弄清楚.
And a file named _other_stuff.html.erb and it all works, but when I copy these little snippets, I get the above error. Any ideas? Something is going on here that I need to figure out.
推荐答案
原来我没有
render :something
在我的控制器方法中,所以我猜 Rails 认为某个地方必须有一个delete_stuff.erb"才能知道该怎么做.添加了渲染,错误消息消失了.
in my controller method, so I guess Rails figured that there must be a "delete_stuff.erb" somewhere to know what to do. Added a render and the error message goes away.
这篇关于Rails 消息:ActionView::MissingTemplate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!