I have this code:
<% form_for(@repair_ticket) do |f| %> <p> <%= text_field_with_auto_complete :rp_part, :name %> <p> <b>Client</b><br /> <select name="repair_ticket[client_id]"> <% @clients.each do |client| %> <option value="<%= client.id %>" <%= ' selected' if client.id == @repair_ticket.client_id %>> <%= client.name %> </option> <% end %> </select></p>
How can I ;order => client.name all the results in the list ?