This project is archived and is in readonly mode.
collection_size locals in collection partials
Reported by Michael Bumann | August 7th, 2008 @ 01:34 PM | in 2.x
This patch adds collectionsize, firstincollection and lastin_collection local assigns to partial collections.
it basicly just sets:
local_assigns[:collection_size] = collection.size
local_assigns[:first_in_collection] = index == 0
local_assigns[:last_in_collection] = index == collection.size-1
in the renderpartialcollection method.
this gives you more flexibility in designing partials that are rendered in collections.
Issues: since the local assigns are just added to partials that are renderd in collections it is not available if a single partial is rendered.
Comments and changes to this ticket
-
DHH August 16th, 2008 @ 05:30 AM
- State changed from new to wontfix
See reasoning for wontfix on #836
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 836 PATCH: assign collection_size local variable in partials see also: #772