inside_layout Broken in Rails 2.1

My good old friend for nested layouts, inside_layout

def inside_layout(layout, &block)
  layout = layout.include?('/') ? layout : "layouts/#{layout}"
  concat(@template.render_file(layout, true,
    '@content_for_layout' => capture(&block)), block.binding)
end

suddenly stopped to work, and since i am so grateful for his long months of service, he got replaced by the next best thing 😉

<% @content_for_layout = capture do %>
...some text or html...
<%= render :file=>'layouts/application', :content_for_layout => @content_for_layout %>
 
Advertisements

2 thoughts on “inside_layout Broken in Rails 2.1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s