Skip to content
Newer
Older
100644 24 lines (17 sloc) 873 Bytes
fc79487 @adymo Initial import of template inliner plugin - the plugin that
adymo authored
1 Template inliner avoids the problem when to render a large list of objects,
2 Rails creates a large number of View instances, requiring additional CPU and memory
3 for each of them.
4
5 Example situation:
6 <% for object in objects %> #1000 times
7 <%= render :partial => 'object', :locals => { :object => object } %>
8 <% end %>
9
10
11 Template inliner will include the source of the partial into the
12 template where it's rendered from before Rails starts processing the template.
13
14 To use, just add :inline => true to the 'render' call.
15 Note, the entire call to render inlined partial must be on the one line for
16 template inliner to work.
17
18 Example:
19 <% for object in objects %> #1000 times
20 <%= render :partial => 'object', :locals => { :object => object }, :inline => true %>
21 <% end %>
22
23 Copyright (c) 2008-2009 Pluron, Inc. Released under the MIT license.
Something went wrong with that request. Please try again.