DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-19 21:34 UTC
Multiple selects in single view
I have three multiple selects in a single view: <label for="technicians">Technicians:</label><br /> <select id="technicians" name="technicians[]" multiple="multiple" size="5" style="width:250px;"> <%options_from_collection_for_select(@all_technicians, :id, :name, @selected_technicians) %> </select> <label for="computers">Computer Models:</label><br /> <select id="computers" name="computers[]" multiple="multiple" size="3" style="width:150px;"> <%options_from_collection_for_select(@all_computers, :id, :model, @selected_computers) %> </select> <label for="licensed_programs">Licensed Software:</label><br /> <select id="licensed_programs" name="licensed_programs[]" multiple="multiple" size="8" style="width:200px"> <%options_from_collection_for_select(@all_licensed_programs, :id, :name, @selected_licensed_programs) %> </select> The select lists populate with no trouble. The problem I''m having is that only the first one works. After creating an entry via the view the only join table that is populated is sites_technicians. The other two are completely blank. Any hints, advice, beratement etc. would be greatly appreciated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-19 22:20 UTC
Re: Multiple selects in single view
Here is the page source it generates. I don''t see anything significantly different between the three multi-selects. <p> <label for="technicians">Technicians:</label><br /> <select id="technicians" name="technicians[]" multiple="multiple" size="5" style="width:250px;"> <option value="4">Albert Martinez</option> <option value="6">Chris Sanchez</option> <option value="3">Luis Arvizu</option> <option value="5">Orlando Garcia</option> <option value="2">Richard Martinez</option> <option value="1">Thao Dang</option> </select> </p> <p> <label for="computers">Computer Models:</label><br /> <select id="computers" name="computers[]" multiple="multiple" size="3" style="width:150px;"> <option value="1">Dell GX240</option> </select> </p> <p> <label for="licensed_programs">Licensed Software:</label><br /> <select id="licensed_programs" name="licensed_programs[]" multiple="multiple" size="8" style="width:200px"> <option value="1">VIZ</option> </select> </p> On Feb 19, 2:34 pm, "DamnBig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <DamnBig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have three multiple selects in a single view: > > <label for="technicians">Technicians:</label><br /> > <select id="technicians" name="technicians[]" multiple="multiple" > size="5" style="width:250px;"> > <%> options_from_collection_for_select(@all_technicians, :id, :name, > @selected_technicians) %> > </select> > > <label for="computers">Computer Models:</label><br /> > <select id="computers" name="computers[]" multiple="multiple" size="3" > style="width:150px;"> > <%> options_from_collection_for_select(@all_computers, :id, :model, > @selected_computers) %> > </select> > > <label for="licensed_programs">Licensed Software:</label><br /> > <select id="licensed_programs" name="licensed_programs[]" > multiple="multiple" size="8" style="width:200px"> > <%> options_from_collection_for_select(@all_licensed_programs, :id, :name, > @selected_licensed_programs) %> > </select> > > The select lists populate with no trouble. > > The problem I''m having is that only the first one works. After > creating an entry via the view the only join table that is populated > is sites_technicians. The other two are completely blank. Any hints, > advice, beratement etc. would be greatly appreciated.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---