Paul Singh
2009-Oct-09 22:27 UTC
Using auto_complete on multiple text_fields within a form
I''ve got a model with a number of attributes -- a bicycle with all of the various components on it. When the user enters the bike''s make and model (among other things), I want to make sure that we don''t duplicate a brand name (for example: Fuji is a single brand and it would suck to have Fuji, fujee and fUGI in the DB somehow). I''ve been tinkering with the auto_complete plugin and have managed to get it to work for a single attribute of the bike model. Is there a way to get it to work with multiple fields within the same form? If there''s an alternative way to handle this, I''m all ears!
Norm Scherer
2009-Oct-10 16:50 UTC
Re: Using auto_complete on multiple text_fields within a form
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Paul Singh wrote: <blockquote cite="mid:ea0491c4-2588-49a8-a263-de90e032a223-lWAbTibLSuyqU3xM50F4S2B/v6IoIuQB4b8TPpkIZ3Q@public.gmane.orgcom" type="cite"> <pre wrap="">I''ve got a model with a number of attributes -- a bicycle with all of the various components on it. When the user enters the bike''s make and model (among other things), I want to make sure that we don''t duplicate a brand name (for example: Fuji is a single brand and it would suck to have Fuji, fujee and fUGI in the DB somehow). I''ve been tinkering with the auto_complete plugin and have managed to get it to work for a single attribute of the bike model. Is there a way to get it to work with multiple fields within the same form? If there''s an alternative way to handle this, I''m all ears! </pre> </blockquote> Why not just give a select list of the brands. You can make up a table with all the brands (with maybe an ''other'' for strange ones) and make a select list from that that the user can pick from. That way you will not get alternative versions.<br> <br> Norm<br> <br> --~--~---------~--~----~------------~-------~--~----~<br> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. <br> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en<br> -~----------~----~----~----~------~----~------~--~---<br> </body> </html> <br>