I fixed it by first saving yield to a local
<% yield_output = yield %>
...
<% yield_output %>
Still wondering I couldn''t just do <%= yield %>
On Apr 2, 10:17 am, apramanik
<abh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi all,
>
> I''m trying to get a nested partial to display, butyieldkeeps
> displaying the previousrender''syield.
>
> I have a view:
>
> <%> render(
> :partial => ''user/edit_photo'',
> :layout => ''shared/edit''
> )
> %>
>
> The partial''s layout:
>
> <div class=''column''>
> <%> render(
> :partial =>
''shared/edit/title'',
> :layout => ''shared/pane'',
> :locals => {
> :pane => View::Pane.new(
''pane-dark'', :filled =>
> View::Pane::FILLED ),
> :done_href =>
''javascript:void(0);''
> }
> )
> %>
> </div>
> <div class=''columns''>
> <div class=''column-l''>
> <%=yield%>
> </div>
> <div class=''column-r''>
> ...
> </div>
> </div>
>
> When the page actually renders, the partial''syieldoutputs
''shared/
> edit/title''. When I remove the rendering of
''shared/edit/title'', theyieldcorrectly outputs
''user/edit_photo''. Why? If you are wondering
> why the view just renders a partial, it is because I have a layout
> that wraps the view and wanted another layout that would do some more
> wrapping.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---