Skip to content

Instantly share code, notes, and snippets.

@peterwmwong
Created July 17, 2011 22:52
Show Gist options
  • Save peterwmwong/1088194 to your computer and use it in GitHub Desktop.
Save peterwmwong/1088194 to your computer and use it in GitHub Desktop.
Example of new cell / R templating in CoffeeScript and equivalent JSP
R '.story',
R 'a.num', storynum
R LabeledCounts, class: 'tasks' # Render LabeledCounts cell
R 'ul.aList',
for a in [0...10]
R 'li', a
if exampleCondition
R '.ifTrue'
else
R '.ifFalse'
<div class='story'>
<a class='num'><%= storynum%></a>
<div class='LabeledCounts tasks'>
<!-- Whatever LabeledCounts cell renders to -->
</div>
<ul class='aList'>
<% for(int i=0; i<10; i++){ %>
<li><%= i %></li>
<% } %>
</ul>
<% if(exampleCondition) { %>
<div class='.ifTrue'></div>
<% } else { %>
<div class='.ifFalse'></div>
<% } %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment