I understand that the layout concept is very similar to OpenSymphony’s
Sitemesh project. I have done a lot of development with Sitemesh, but am
fairly new to Rails. I am wondering if there is a way for a layout in
rails to find out value of a variable from a page it is decorating?
In sitemesh you would be able to do on some page being decorated and then in the layout
page, you can access the value of show_menu using page.getProperty(…)
and can show or hide the menu.
Is there a way to do something like the above in Rails?
For example a template t1.rhtml could be:
And this is the layout1.rhtml (layout file that t1 gets decorated with):<%[email protected]_for_layout%>
Is this possible in rails? If yes, how?