Created
July 17, 2011 22:52
-
-
Save peterwmwong/1088194 to your computer and use it in GitHub Desktop.
Example of new cell / R templating in CoffeeScript and equivalent JSP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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