本文介绍了如何更改默认布局目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序具有位于 Utilisation 模块下的站点公共部分的所有控制器,它们都继承自 Utilisation::UtilisationController.我想为这些控制器设置默认布局utilisation/layouts/*.html.erb".
My application has all the controllers for the public part of the site scoped under the Utilisation module and they all inherit from the Utilisation::UtilisationController. I want to make the default layout for these controllers 'utilisation/layouts/*.html.erb'.
我尝试通过:
layout 'utilisation/layouts/application.html.erb'但我明白
ActionView::MissingTemplate (Missing layout layouts/utilisation/application ...如何更改默认布局目录?
How can I change the default layout directory ?
推荐答案路径是相对于 layouts 文件夹的.试试:
The path is relative to layouts folder. Try:
layout '../utilisation/layouts/application' # without .html.erb is fine更多推荐
如何更改默认布局目录?
发布评论