CoffeeScript, SCSS, Backbone, jQuery and Eco templates Example

A small example of using these awesome libraries all together. You may use this a starting template for a more interesting fiddle :)

HTML

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://sstephenson.github.com/eco/dist/eco.js"></script>
<textarea id="example" class="template">
<% for thing, i in @things: %>
    <%= i %>: <%= thing %></br>
<% end %>
</textarea>

SCSS

.temaplte { display: none; }

CoffeeScript

renderTemplate = (id, locals) -> 
  source = $('#' + id).val()
  try
    eco.render source, locals
  catch e
    "Error: #{e}"

$('body').html renderTemplate 'example', things: ['Eco', 'For', 'Example']