Let''s say I have a dropdown selection list of existing teachers. The user can (1) select any one teacher, or (2) create a new one. How would you tackle something like that? I''m thinking what I could do is check if there''s any data inputted into the "new teacher" field -- and if there is, create a new teacher. But, the issue with that is the user might also have an existing teacher highlighted, so that creates confusion -- (not to mention bad usability!) Based on your supreme knowledge, how would you approach something like this? -- 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 -~----------~----~----~----~------~----~------~--~---
Mohit Sindhwani
2007-Aug-24 10:01 UTC
Re: "Choose from These Options, or Create a New Option"
Bob Sanders wrote:> Let''s say I have a dropdown selection list of existing teachers. The > user can (1) select any one teacher, or (2) create a new one. > > How would you tackle something like that? > > I''m thinking what I could do is check if there''s any data inputted into > the "new teacher" field -- and if there is, create a new teacher. But, > the issue with that is the user might also have an existing teacher > highlighted, so that creates confusion -- (not to mention bad > usability!) > > Based on your supreme knowledge, how would you approach something like > this? >I don''t think you should allow people to create new teachers this way - you need to control the quality of people who teach the future!! :-) But seriously, I''ve given the same thing some thought for one of my applications (and haven''t yet implemented anything for it) but in my opinion, there are a couple of main ways to do it: 1. Have an option for ''Other (enter below):'' and the person has to select that option and enter a name in the new teacher box. 2. Use Javascript & AJAX that if such an option is selected, it darkens out some of the screen and shows a div that allows you to create a new teacher record and then updates the select box. 3. Have a checkbox that allows you to create a new teacher. When the user checks it, the drop down select list is hidden and a new field is shown for creating a teacher. What do you think? Cheers, Mohit. 8/24/2007 | 6:01 PM. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Aug-24 15:55 UTC
Re: "Choose from These Options, or Create a New Option"
> Let''s say I have a dropdown selection list of existing teachers. The > user can (1) select any one teacher, or (2) create a new one. > > How would you tackle something like that? > > I''m thinking what I could do is check if there''s any data inputted into > the "new teacher" field -- and if there is, create a new teacher. But, > the issue with that is the user might also have an existing teacher > highlighted, so that creates confusion -- (not to mention bad > usability!)You could use auto_complete_field to have a simple text field. They type in the name, it pulls up a list. If they don''t like one of those options, they finish typing and (assuming you only need the teacher''s name) you create a new teacher record when they submit the form. If you need more information, I''d have a "Other/New" option in the select box, and have it overlay a div asking for that info like the other poster suggested. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Philip and Mohit, Thank you for the replies! I''m going to try all of your various ideas and see which works best. The AJAX one sounds really cool, and I think would be very use-friendly if done right. Of course, relying on my skills isn''t the best, so we''ll see what happens :) Thanks again! -- 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 -~----------~----~----~----~------~----~------~--~---
Mohit Sindhwani
2007-Aug-26 09:03 UTC
Re: "Choose from These Options, or Create a New Option"
Bob Sanders wrote:> Philip and Mohit, > > Thank you for the replies! I''m going to try all of your various ideas > and see which works best. The AJAX one sounds really cool, and I think > would be very use-friendly if done right. > > Of course, relying on my skills isn''t the best, so we''ll see what > happens :) > > Thanks again! >Bob, If you do get the AJAX one done, do consider sharing :) Cheers, Mohit. 8/26/2007 | 5:03 PM. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 8/26/07, Mohit Sindhwani <mo_mail-RxrYI66vbj0AvxtiuMwx3w@public.gmane.org> wrote:> > Bob Sanders wrote: > > Philip and Mohit, > > > > Thank you for the replies! I''m going to try all of your various ideas > > and see which works best. The AJAX one sounds really cool, and I think > > would be very use-friendly if done right. > > > > Of course, relying on my skills isn''t the best, so we''ll see what > > happens :) > > > > Thanks again! > > > > Bob, > > If you do get the AJAX one done, do consider sharing :)I do this in quite a few different places in my app.. In one instance, an Event belongs_to a venue, so I give the user the option to select any venue from a list, or they can create a new one by clicking on the "Create new venue..." option in the dropdown (I use a javascript onclick handler to detect when they select the appropriate option). I then display a hidden div which contains a form for creating a new venue. An event can also be associated with an artist, so I use an ajax autocomplete field to display a list of artists. I then use something like @event.artist Artist.find_or_initialize_by_artist_name(params[:artist_name]) which will either retrieve the Artist with the given name, or it''ll create a new instance, which will then be saved when I call @event.save. So the Ajax code isn''t necessarily very complicated, it''s just a standard autocomplete field and uses find_or_initialize_by_*. Adam --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---