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
On Dec 30, 10:14 am, net
<hengr...-oe7qfRrRQfdIcsJQ0EH25Q@public.gmane.org>
wrote:> 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 ###
> </div>
>
> Am I using layouts/partials incorrectly?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---