Skip to content
Myr

Added partial migration docs

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

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 0b86ce2 · Browse files · 3 files+93 added−1 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+93 added−1 removed

  • other:+93 added−1 removed

3 files+93 added−1 removed

modified:docs/migrate.1+52 added
177 unmodified lines
178.179.fi180.181.IP "" 0182.183.P184Previously rendering of a collection via \fBpartial()\fR would look something like this:185.186.IP "" 4187.188.nf189190this\.partial(\'comment\.html\.haml\', { collection: comments });191.192.fi193.194.IP "" 0195.196.P197Although this worked just fine, it was generally to verbose, the similar but new API looks like this, as \fBpartial()\fR is \fIalways\fR passed as a local variable:198.199.IP "" 4200.201.nf202203partial(\'comment\.haml\', { collection: comments });204.205.fi206.207.IP "" 0208.209.P210To make things even less verbose we can assume the extension when ommitted:211.212.IP "" 4213.214.nf215216partial(\'comment\', { collection: comments });217.218.fi219.220.IP "" 0221.222.P223And once again even further, when rendering a collection we can simply pass an array, if no other options are desired:224.225.IP "" 4226.227.nf228229partial(\'comments\', comments);230.231.fi232.233.IP "" 0234
modified:docs/migrate.html+22 added
271 unmodified lines
272 });273});274</code></pre>275276<p>Previously rendering of a collection via <code>partial()</code> would look something like this:</p>277278<pre><code>this.partial('comment.html.haml', { collection: comments });279</code></pre>280281<p>Although this worked just fine, it was generally to verbose, the similar but new API282looks like this, as <code>partial()</code> is <em>always</em> passed as a local variable:</p>283284<pre><code>partial('comment.haml', { collection: comments });285</code></pre>286287<p>To make things even less verbose we can assume the extension when ommitted:</p>288289<pre><code>partial('comment', { collection: comments });290</code></pre>291292<p>And once again even further, when rendering a collection we can simply pass293an array, if no other options are desired:</p>294295<pre><code>partial('comments', comments);296</code></pre>297298</div>299 </div>300 </div>301 </body>
1 unmodified line
modified:docs/migrate.md+19 added-1 removed