# Layouts with variables

**URL:** <https://www.ruby-forum.com/t/layouts-with-variables/105067>\
**Category:** Rails\
**Created:** [May 25, 2007, 1:59pm UTC](https://www.ruby-forum.com/t/layouts-with-variables/105067 "2007-05-25T13:59:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartocc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c68b51/32.png) [@bartocc](https://www.ruby-forum.com/u/bartocc)\
**Post date:** [May 25, 2007, 1:59pm UTC](https://www.ruby-forum.com/t/layouts-with-variables/105067/1 "2007-05-25T13:59:34Z")

</div>

Hi,

I would like to render a menu thx to a YAML file inside on of my  
layouts.  
So far, the only hack I have found is to YAML.load\_file inside an ERB  
in the layout.

I don’t really like this, and there must be a better way to do so. I  
just don’t know how 😉

Could anyone help me on this ?

Thx
