How to use frame in RoR

hello i want to use frame in RoR .. how to create frame in RoR?

Attachments: http://www.ruby-forum.com/attachment/2701/frame_example.JPG

Hi, The normal way is to define the general structure of your page in the layout (layouts/application.html.erb). For simple sites, you just use one layout for all your views, so if you use script/generate to make your controllers, remove the automatically generated layouts for each controller.

Your layout would contain the various pieces of the page: <body>   <div id="header">      some common content here. logo, title, etc...      use variables like <%= pagetitle %> that are set in your controller/actions   </div>   <div id="left_nav">      this is your left navigation menu      <%= render :partial => shared/menu %> to render _menu.html.erb %> </div> <div id="main">      This is the content for the view being called      <%= yield %> </div> <div id="footer">     <%= render :partial => shared/footer %> </div>

If you have specific content that needs to be displayed in one of your 'frames' depending on the main view, you can call this in your view: <% content_for :left_nav %>    some specific content here <% end %> and you should call <%= yield :left_nav %> in your layout.

Finally in your css you define the positioning/styling of your various layout divs.

thanks ! i want specific content for each n every frame ! is it possible ? to get dynamic content for each n every content ?

Dharmdip Rathod wrote:

thanks ! i want specific content for each n every frame ! is it possible ? to get dynamic content for each n every content ?

Surely. content_for just routes the output to the appropriate named div.

Individual views can use or ignore divs as they see fit, depending on what they are to render.

The app template is just that. If your template includes empty placeholders for all the different content snippets, you just use the suggested content_for construct and send the rendered data to the appropriate div.

Ar Chron wrote:

Dharmdip Rathod wrote:

thanks ! i want specific content for each n every frame ! is it possible ? to get dynamic content for each n every content ?

Surely. content_for just routes the output to the appropriate named div.

Individual views can use or ignore divs as they see fit, depending on what they are to render.

The app template is just that. If your template includes empty placeholders for all the different content snippets, you just use the suggested content_for construct and send the rendered data to the appropriate div.

thx ! chron