私は現在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
これを達成する最も簡単な方法は何ですか?