hi, i''ve 2 tables as locations and customers. they have "has_many" rel''ship.(1 loc has many custs). i''d gone thru http://trix.pl/blog/ruby-on-rails/auto-complete-for-rails-2-0-tutorial this tutorial that worked fine. but my issue is, i want to have an auto complete text field for customer_id in new location form that will show customer name but store id in the table when created. Can anybody help in this? I hope i''ve provided enough details... -Dhaval -- 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 -~----------~----~----~----~------~----~------~--~---
On Apr 14, 2008, at 14:35 , Dhaval Phansalkar wrote:> i''ve 2 tables as locations and customers. they have "has_many" > rel''ship.(1 loc has many custs). i''d gone thru > http://trix.pl/blog/ruby-on-rails/auto-complete-for-rails-2-0-tutorial > this tutorial that worked fine. but my issue is, i want to have an > auto > complete text field for customer_id in new location form that will > show > customer name but store id in the table when created. Can anybody help > in this? I hope i''ve provided enough details...Have a look at model_auto_completer: http://agilewebdevelopment.com/plugins/model_auto_completer -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Xavier Noria wrote:> On Apr 14, 2008, at 14:35 , Dhaval Phansalkar wrote: > >> i''ve 2 tables as locations and customers. they have "has_many" >> rel''ship.(1 loc has many custs). i''d gone thru >> http://trix.pl/blog/ruby-on-rails/auto-complete-for-rails-2-0-tutorial >> this tutorial that worked fine. but my issue is, i want to have an >> auto >> complete text field for customer_id in new location form that will >> show >> customer name but store id in the table when created. Can anybody help >> in this? I hope i''ve provided enough details... > > Have a look at model_auto_completer: > > http://agilewebdevelopment.com/plugins/model_auto_completer > > -- fxnhi xavier, i''d tried that,it doesn''t get installed. when i run this command "ruby script/plugin install svn://rubyforge.org/var/svn/model-ac/trunk/vendor/plugins/model_auto_completer" , nothing happens. -dhaval -- 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 -~----------~----~----~----~------~----~------~--~---
Xavier Noria wrote:> On Apr 14, 2008, at 14:35 , Dhaval Phansalkar wrote: > >> i''ve 2 tables as locations and customers. they have "has_many" >> rel''ship.(1 loc has many custs). i''d gone thru >> http://trix.pl/blog/ruby-on-rails/auto-complete-for-rails-2-0-tutorial >> this tutorial that worked fine. but my issue is, i want to have an >> auto >> complete text field for customer_id in new location form that will >> show >> customer name but store id in the table when created. Can anybody help >> in this? I hope i''ve provided enough details... > > Have a look at model_auto_completer: > > http://agilewebdevelopment.com/plugins/model_auto_completer > > -- fxnhi Xavier, i''d tried that,it doesn''t get installed. when i run this command "ruby script/plugin install svn://rubyforge.org/var/svn/model-ac/trunk/vendor/plugins/model_auto_completer" , nothing happens. -dhaval -- 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 -~----------~----~----~----~------~----~------~--~---
On Apr 14, 2008, at 14:50 , Dhaval Phansalkar wrote:> hi xavier, > i''d tried that,it doesn''t get installed. when i run this command "ruby > script/plugin install > svn://rubyforge.org/var/svn/model-ac/trunk/vendor/plugins/ > model_auto_completer" > , nothing happens.Do you have a svn client installed? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Xavier Noria wrote:> On Apr 14, 2008, at 14:50 , Dhaval Phansalkar wrote: > >> hi xavier, >> i''d tried that,it doesn''t get installed. when i run this command "ruby >> script/plugin install >> svn://rubyforge.org/var/svn/model-ac/trunk/vendor/plugins/ >> model_auto_completer" >> , nothing happens. > > Do you have a svn client installed?yes, i do have it... -- 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 -~----------~----~----~----~------~----~------~--~---
On Apr 14, 2008, at 18:20 , Dhaval Phansalkar wrote:> Xavier Noria wrote: >> On Apr 14, 2008, at 14:50 , Dhaval Phansalkar wrote: >> >>> hi xavier, >>> i''d tried that,it doesn''t get installed. when i run this command >>> "ruby >>> script/plugin install >>> svn://rubyforge.org/var/svn/model-ac/trunk/vendor/plugins/ >>> model_auto_completer" >>> , nothing happens. >> >> Do you have a svn client installed? > > yes, i do have it...That''s suspicious, do you have the command-line client installed and in the PATH? -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Xavier Noria wrote:> On Apr 14, 2008, at 18:20 , Dhaval Phansalkar wrote: > >>> >>> Do you have a svn client installed? >> >> yes, i do have it... > > That''s suspicious, do you have the command-line client installed and > in the PATH? > > -- fxni didn''t get you. but i''m using tortoise and could create an SVN for model_auto_completer. now i have model_auto_completer folder with lib,tasks,test etc. i then copied it to my rails appl in vender/plugin. i also had gone through the docs, but still couldn''t understand how to use it. -- 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 -~----------~----~----~----~------~----~------~--~---
On Apr 15, 2008, at 10:40 , Dhaval Phansalkar wrote:> Xavier Noria wrote: >> On Apr 14, 2008, at 18:20 , Dhaval Phansalkar wrote: >> >>>> >>>> Do you have a svn client installed? >>> >>> yes, i do have it... >> >> That''s suspicious, do you have the command-line client installed and >> in the PATH? >> >> -- fxn > > i didn''t get you. but i''m using tortoise and could create an SVN for > model_auto_completer. now i have model_auto_completer folder with > lib,tasks,test etc. i then copied it to my rails appl in vender/ > plugin.So you have now vendor/plugins/model_auto_completer ?> i also had gone through the docs, but still couldn''t understand how to > use it.Have you read http://model-ac.rubyforge.org/classes/ModelAutoCompleterHelper.html ? -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dhaval Phansalkar wrote: | Xavier Noria wrote: |> On Apr 14, 2008, at 18:20 , Dhaval Phansalkar wrote: |> |>>> Do you have a svn client installed? |>> yes, i do have it... |> That''s suspicious, do you have the command-line client installed and |> in the PATH? |> |> -- fxn | | i didn''t get you. but i''m using tortoise and could create an SVN for | model_auto_completer. You''ll need a command line client to work with script/plugin: http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91 There are nice installers that play with Windows. If the installer doesn''t add Subversion to your path, you can add it yourself in the properties of My Computer, under the Advanced tab, clicking on the button labeled Environment Variables, and adding it to the PATH environment variable. After your next login, you can use svn from the command line. :) - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan Make it clear before you make it faster. ~ - The Elements of Programming Style (Kernighan & Plaugher) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgEcLwACgkQbtAgaoJTgL9DvwCgjjWKC1SNhhEOuMDBV7Dfy/o6 KYQAn3LzVvsuOJNLhux/lppKX+PkQ46C =x6o8 -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Xavier Noria wrote:> On Apr 15, 2008, at 10:40 , Dhaval Phansalkar wrote: > >>> >>> -- fxn >> >> i didn''t get you. but i''m using tortoise and could create an SVN for >> model_auto_completer. now i have model_auto_completer folder with >> lib,tasks,test etc. i then copied it to my rails appl in vender/ >> plugin. > > So you have now > > vendor/plugins/model_auto_completer > > ? > >> i also had gone through the docs, but still couldn''t understand how to >> use it. > > Have you read > > http://model-ac.rubyforge.org/classes/ModelAutoCompleterHelper.html > > ? > > -- fxn@Phillip, Thanks for the info phillip. @Xavier, yes, but not able to decide which method to use... i tried those methods and that gave me the error as "undefined method `belongs_to_auto_completer''" -Dhaval -- 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 -~----------~----~----~----~------~----~------~--~---
On Apr 15, 2008, at 14:41 , Dhaval Phansalkar wrote:> yes, but not able to decide which method to use... i tried those > methods > and that gave me the error as "undefined method > `belongs_to_auto_completer''"That''s a helper and should be used in views. If that''s how you are using it already it may happen that the plugin is not under vendor/plugins, or the server was not restarted.... Unrelated to that error message, but just in case, remember that as in anything related to Ajax you need to include some JavaScript libraries, for example this way: <%= javascript_include_tag :defaults %> -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Xavier Noria wrote:> On Apr 15, 2008, at 14:41 , Dhaval Phansalkar wrote: > >> yes, but not able to decide which method to use... i tried those >> methods >> and that gave me the error as "undefined method >> `belongs_to_auto_completer''" > > That''s a helper and should be used in views. > > If that''s how you are using it already it may happen that the plugin > is not under vendor/plugins, or the server was not restarted.... > > Unrelated to that error message, but just in case, remember that as in > anything related to Ajax you need to include some JavaScript > libraries, for example this way: > > <%= javascript_include_tag :defaults %> > > -- fxni tried all the ways. the folder is in vendor/plugins and server restarted many times. also, have <%= javascript_include_tag :defaults %> in my common template as well as in the page and have latest prototype.js and scriptaculous.js. but the prb still persist. one more thing is, text_field_with_auto_complete works fine but theres a prb that i mentioned in my first post. don''t understand what exactly the prb is... :( i''ll paste the code tomorrow to get more clear idea, if needed. -Dhaval -- 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 -~----------~----~----~----~------~----~------~--~---
Hey, got this thing worked, my mistake... i was putting the code in wrong place. it should be in customers and not in locations. Thanks for the help, anyways... :) -Dhaval -- 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 -~----------~----~----~----~------~----~------~--~---
i found a tutorial here that works properly here http://share-facts.blogspot.com/2009/02/autocompleter-example-in-ruby-on-rails.html -- 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 -~----------~----~----~----~------~----~------~--~---