Tengo este código: <% 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> ¿Como puedo poner ;order => client.name para toda la lista desplegable? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Dude! its a predominantly English forum -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Quoting John Smith <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > Tengo este código: > > <% 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]"><% @client.sort!{|a, b| a.name <=> b.name} %> <% @clients.each do |client| %> o: <% clients = @client.sort{|a, b| a.name <=> b.name} %> <% clients.each do |client| %>> <% @clients.each do |client| %> > <option value="<%= client.id %>" > <%= '' selected'' if client.id == @repair_ticket.client_id %>> > <%= client.name %> > </option> > <% end %> > </select></p> > > ¿Como puedo poner ;order => client.name para toda la lista desplegable?Pardon mi español pobre. Creo que entiendo su pregunta. Vea el código arriba. Jeffrey --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---