Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

collection_size locals in collection partials

#772

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.

Reported by Michael Bumann · August 7th, 2008 @ 01:34 PM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none