From 6e0a763d0047dcaae26fb691757c3407a20e4a84 Mon Sep 17 00:00:00 2001 From: Sergio Arbeo Date: Wed, 7 Mar 2012 00:06:42 +0100 Subject: Adds line to change log and update documentation. --- .../lib/action_view/renderer/partial_renderer.rb | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'actionpack/lib/action_view/renderer') diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb index ac4c8db50e..245a19deec 100644 --- a/actionpack/lib/action_view/renderer/partial_renderer.rb +++ b/actionpack/lib/action_view/renderer/partial_renderer.rb @@ -158,6 +158,43 @@ module ActionView # Name: <%= user.name %> # # + # If a collection is given, the layout will be rendered once for each item in the collection. Just think + # these two snippets have the same output: + # + # <%# app/views/users/_user.html.erb %> + # Name: <%= user.name %> + # + # <%# app/views/users/index.html.erb %> + # <%# This does not use layouts %> + # + # + # <%# app/views/users/_li_layout.html.erb %> + #
  • + # <%= yield %> + #
  • + # + # <%# app/views/users/index.html.erb %> + # + # + # Given two users whose names are Alice and Bob, these snippets return: + # + # + # # You can also apply a layout to a block within any template: # # <%# app/views/users/_chief.html.erb &> -- cgit v1.2.3