Skip to content

Instantly share code, notes, and snippets.

@rx
Created August 8, 2011 16:53
Show Gist options
  • Save rx/1132170 to your computer and use it in GitHub Desktop.
Save rx/1132170 to your computer and use it in GitHub Desktop.
<select id="<%= options.id %>" name="<%= options.name %>"
<% if((!options.blank && collection.size()==0) ||
options.disabled ){ %>
disabled="disabled"
<% }; %>
>
<% if(options.blank){ %>
<option value=''><%= options.blank %></option>
<% }; %>
<% collection.each(function(item) { %>
<option value="<%= item.get('id') %>"
<% if(selected && selected.id==item.id){%>selected='selected'<%}%> >
<%= item.get('name') %>
</option>
<% }); %>
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment