Forum: Ruby on Rails How to let the layout be more OO?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
pinnacle (Guest)
on 2006-03-17 06:58
I am confused about the @content_for_layout.'cause it will display all
the views in the layout.Do I have any methods to let the layout be more
OO? I mean that for example,the app currently have more than one views
to be displayed,but only some of them to be displayed at the same time
at different <div></div> units. I hope there exists a kind of way that:
 <%= if condition1 %>
 <div id='condition1'>
    <%= @content_for_view1 %>
 </div>
 <%= if condition2 %>
 <div id='condition2'>
    <%= @content_for_view2 %>
 </div>
....

How to reach such an aim in rails? I am a newbie. very grateful!
This topic is locked and can not be replied to.