Forum: Ruby on Rails Problem with render :layout with yield :something inside in Rails 2.2.2

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.
Szymon N. (Guest)
on 2009-01-16 13:14
(Received via mailing list)
Hi,

I got something like this:

_inner_layout.erb.html
<%= yield %>
<%= yield :sidebar %>

index.erb.html
<% render :layout => "inner_layout" do %>
  should be rendered only once
<% end %>

After switching from Rails 2.1 to 2.2 the code above renders "should
be rendered only once" twice. If I add:
<% content_for :sidebar do %>
<% end %>

then everything is ok.
This topic is locked and can not be replied to.