Skip to content

Instantly share code, notes, and snippets.

@plasticine
Created June 29, 2011 03:04
Show Gist options
  • Save plasticine/1052887 to your computer and use it in GitHub Desktop.
Save plasticine/1052887 to your computer and use it in GitHub Desktop.
<li>
<% editors = Editor.all() %>
<select class="<%= (editors.map(&:id).include?(params[:id].to_i)) ? 'active' : '' %>">
<option value="">filter</option>
<option value="everyone">everyone</option>
<% editors.sort_by(&:friendly_name).each do |editor| %>
<option value="<%= editor.id %>" <%= (params[:id] == "#{editor.id}") ? 'selected' : '' %>><%= editor.friendly_name %></option>
<% end %>
</select>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment