在子文件夹中分组的部分 [英] Partials grouped in sub-folder
本文介绍了在子文件夹中分组的部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个依赖于几个部分的视图.为了对这些部分进行分组,我将它们移到了一个子文件夹中,但是当我调用部分时,我得到一个 Missing template client_demographics/_age.erb in view path app/views
错误.
I have a view that relies on several partials. In wanting to group these partials, I moved them into a sub-folder but when I call the partial I get a Missing template client_demographics/_age.erb in view path app/views
error.
我的部分文件夹结构:
app
views
reports
client_demographics
_age.html.haml
_gender.html.haml
client_demographics.html.haml
在我看来,我如何调用部分:
How I am calling the partial in my view:
= render :partial => "client_demographics/age"
推荐答案
您将需要使用 app/views
文件夹中的路径
You will need to use the path from the app/views
folder
= render :partial => "reports/client_demographics/age"
这篇关于在子文件夹中分组的部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文