<button><%= coffee.attr('roaster') %></button>
<input type='checkbox'
<%= coffee.attr('acidic') ? 'checked' : '' %> /><%= coffee.attr('roaster') %>
<a href="javascript://"><%= coffee.attr('roaster') %></a>
<textarea><%= coffee.attr('region.name') %></textarea>
<input type='text' value="<%= coffee.attr('roaster') %>"/>
Template:
<select class='pulldown'>
<% alternatives.each(function(item, index){ %>
<option value="<%= index %>" <%= model.attr(content) == item ? "selected" : "">
<%= item.attr(this.altLabelContent) %>
</option>
<% }) %>
</select>
Pulldown = can.Control({
init : function(){
this.element.html( can.view('pulldowntemplate',this.options ) );
},
"change" : function(){
this.options.model.attr(this.options.content, this.options.alternatives[this.element.val()] );
}
})
<% regions.each(function( region ) { %>
<li><%== can.view.render("SUBTEMPLATE", region ) %></li>
<% }) %>