Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix render (include :file and :locals)

  • Loading branch information...
commit b1a2028b44b3fedef50e0aba81a63c58c04b5987 1 parent e482d42
Wiktor Schmidt authored
View
2  lib/vanity/templates/_experiment.erb
@@ -1,5 +1,5 @@
<h3><%=vanity_h experiment.name %> <span class="type">(<%= experiment.class.friendly_name %>)</span></h3>
<%= experiment.description.to_s.split(/\n\s*\n/).map { |para| vanity_html_safe(%{<p class="description">#{vanity_h para}</p>}) }.join %>
-<%= render Vanity.template(experiment.type), :experiment=>experiment %>
+<%= render :file => Vanity.template(experiment.type), :locals => {:experiment => experiment} %>
<p class="meta">Started <%= experiment.created_at.strftime("%a, %b %d") %>
<%= " | Completed #{experiment.completed_at.strftime("%a, %b %d")}" unless experiment.active? %></p>
View
2  lib/vanity/templates/_experiments.erb
@@ -1,7 +1,7 @@
<ul class="experiments">
<% experiments.sort_by { |id, experiment| experiment.created_at }.reverse.each do |id, experiment| %>
<li class="experiment <%= experiment.type %>" id="experiment_<%=vanity_h id.to_s %>">
- <%= render Vanity.template("experiment"), :id=>id, :experiment=>experiment %>
+ <%= render :file => Vanity.template("experiment"), :locals => { :id => id, :experiment => experiment } %>
</li>
<% end %>
</ul>
Please sign in to comment.
Something went wrong with that request. Please try again.