如何更改默认布局目录?

编程入门 行业动态 更新时间:2024-10-26 21:33:07
本文介绍了如何更改默认布局目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的应用程序具有位于 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

更多推荐

如何更改默认布局目录?

本文发布于:2023-07-04 10:07:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1023052.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:布局   如何更改   目录

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!