我有一个依赖于几个部分的观点。为了将这些部分分组,我将它们移动到一个子文件夹中,但是当我调用部分时,我得到了 Missing template client_demographics/_age.erb in view path app/views
错误。
我的部分文件夹结构:
app
views
reports
client_demographics
_age.html.haml
_gender.html.haml
client_demographics.html.haml
在我看来,我如何称呼部分:
= render :partial => "client_demographics/age"
最佳答案
您将需要使用来自 app/views
的路径。文件夹
= render :partial => "reports/client_demographics/age"
关于ruby-on-rails - 在子文件夹中分组的部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6880044/