# Layout with yield usage?

**URL:** <https://www.ruby-forum.com/t/layout-with-yield-usage/156615>\
**Category:** Rails\
**Created:** [December 30, 2008, 11:39pm UTC](https://www.ruby-forum.com/t/layout-with-yield-usage/156615 "2008-12-30T23:39:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![net](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/9de0a6/32.png) [@net](https://www.ruby-forum.com/u/net)\
**Post date:** [December 30, 2008, 11:39pm UTC](https://www.ruby-forum.com/t/layout-with-yield-usage/156615/1 "2008-12-30T23:39:31Z")

</div>

Hi!

Im having this weird problem when the yield gets overwritten with the  
last yield used… My application layout looks like this:

```
    <div id="left_sidebar">
        <%= render :partial => "shared/navigation" %>
    </div>

    <div id="main_content">
        <%= yield %>
    </div>

```

And the output becomes:

```
    <div id="left_sidebar">
        ### NAVIGATION CONTENT ###
    </div>

    <div id="main_content">
        ### NAVIGATION CONTENT ### <-- i want this to be ###

```

MAIN CONTENT ###

Am I using layouts/partials incorrectly?

---

<div class="post-metadata">

**Author:** ![net](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/9de0a6/32.png) [@net](https://www.ruby-forum.com/u/net)\
**Post date:** [December 31, 2008, 1:10am UTC](https://www.ruby-forum.com/t/layout-with-yield-usage/156615/2 "2008-12-31T01:10:25Z")

</div>

Use \<%= yield :navigation %\> in your layout instead of the  
render :partial, and use content\_for :navigation in your view(s).  
Watch Railscast 8.

Also, have you checked to see whether your nav render is duplicated in  
the view?

-eric
