Rails shared layout 会覆盖 gobal layout,有无方法继承?

hunkguo · 2013年09月23日 · 最后由 jarorwar 回复于 2013年09月25日 · 2104 次阅读

全站能用导航头,左侧菜单,每个模块不一样,原本希望导航放在 gobal 中,左侧菜单放在 shared 中,无奈不能实现。 请问 layout,大家是如何灵活使用 layout 的?

再请问下,如何在在页面中判断左侧菜单并变色呢? 使用 content_for 判断,默认输出结果的话,不支持 html 代码,只支持纯文本。

可以在 controller 中指定具体的 layout 也可以在 action 中指定~!

有五种 layout 哦 gobal layout,controller layout,shared layout,dynamic layout,action layout

需要 登录 后方可回复, 如果你还没有账号请 注册新账号