Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created October 7, 2009 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save defunkt/204222 to your computer and use it in GitHub Desktop.
Save defunkt/204222 to your computer and use it in GitHub Desktop.
ERB and Mustache side-by-side
<h1><%= header %></h1>
<% if not item.empty? %>
<ul>
<% for i in item %>
<% if i[:current] %>
<li><strong><%= i[:name] %></strong></li>
<% else %>
<li><a href="<%= i[:url] %>"><%= i[:name] %></a></li>
<% end %>
<% end %>
</ul>
<% end %>
<% if item.empty? %>
<p>The list is empty.</p>
<% end %>
<h1>{{header}}</h1>
{{#list}}
<ul>
{{#item}}
{{#current}}
<li><strong>{{name}}</strong></li>
{{/current}}
{{#link}}
<li><a href="{{url}}">{{name}}</a></li>
{{/link}}
{{/item}}
</ul>
{{/list}}
{{#empty?}}
<p>The list is empty.</p>
{{/empty?}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment