Skip to content
Myr

Passing __index__, __length__, __isFirst__, __isLast__ to collection partials. Closes #254

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent a74c259 · Browse files · 3 files+24 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+24 added−2 removed

  • tests:+17 added−0 removed
  • other:+7 added−2 removed

3 files+24 added−2 removed

modified:lib/express/plugins/view.js+7 added-2 removed
added:spec/fixtures/partials/article.haml.html+6 added
modified:spec/spec.plugins.view.js+11 added
55 unmodified lines
56 })57 get('/').body.should.include '<li>im a movie'58 get('/').body.should.include '<li>im another movie'59 end60 61 it 'should pass __isFirst__, __isLast__, and __index__ to partials as locals'62 get('/', function(){63 return this.partial('article.haml.html', {64 collection: ['a', 'b', 'c']65 })66 })67 get('/').body.should.include '<li class="first">a'68 get('/').body.should.include '<li class="1">b'69 get('/').body.should.include '<li class="last">c'70 end71 end72 end73 74 describe '#render()'
130 unmodified lines