【发布时间】:2013-03-12 22:27:23
【问题描述】:
我目前在 Rails 项目中,我想在不属于布局的视图中覆盖 body 标记中定义的属性。
像这样:
app/views/layouts/application.haml
...header
%body
= render 'shared/menu'
.container
= yield
在另一个视图中。我希望body标签具有某些属性:
app/views/stuff/index.haml
{data: {spy: 'scroll', target: '.d-sidebar', :'twttr-rendered' => 'true'}} << these attributes should apper in the body tag of the layout file. They should only be visible on the sub page
实现这一目标的最简单方法是什么?
【问题讨论】:
标签: ruby-on-rails ruby haml