Hi, I want to create a select form and based on what the user chooses on the select form, I want to connect to different tables and display the content. I''m clueless on how to go about it. Any pointers would be 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 -~----------~----~----~----~------~----~------~--~---
On 6/7/07, anitawa <anitawa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I want to create a select form and based on what the user chooses on > the select form, I want to connect to different tables and display the > content. > > I''m clueless on how to go about it. > Any pointers would be appreciated. > > > > >The select helper is your friend http://api.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelper.html#M000506 -- Cyril Mougel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks... i got the select option set up...but how would i get data from diffrerent tables depending on user''s choice? On Jun 7, 2:24 pm, "Cyril Mougel" <cyril.mou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 6/7/07, anitawa <anit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > I want to create a select form and based on what the user chooses on > > the select form, I want to connect to different tables and display the > > content. > > > I''m clueless on how to go about it. > > Any pointers would be appreciated. > > The select helper is your friend > > http://api.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelp... > > -- > Cyril Mougel--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
tyler.a.montgomery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-07 23:13 UTC
Re: beginner question...really.
Hi there, I''m not sure if this is exactly what you want but it got me going down the right path a while ago: http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=5 This will walk you through getting specific data into the select form from a db table. There''s also a way to do this with AJAX auto_complete http://slash7.com/articles/2005/8/13/ajaxariffic-autocomplete-with-scriptaculous Hope this helps! Tyler On Jun 7, 5:07 pm, anitawa <anit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks... > i got the select option set up...but how would i get data from > diffrerent tables depending on user''s choice? > > On Jun 7, 2:24 pm, "Cyril Mougel" <cyril.mou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On 6/7/07, anitawa <anit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > > > I want to create a select form and based on what the user chooses on > > > the select form, I want to connect to different tables and display the > > > content. > > > > I''m clueless on how to go about it. > > > Any pointers would be appreciated. > > > The select helper is your friend > > >http://api.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelp... > > > -- > >Cyril Mougel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks...i dont think i was clear im not looking to populate the select form from db table. im looking to get data off different db tables depending on the choice that the user makes from the select form. On Jun 7, 4:13 pm, "tyler.a.montgom...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <tyler.a.montgom...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi there, > I''m not sure if this is exactly what you want but it got me going down > the right path a while ago: > > http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=5 > > This will walk you through getting specific data into the select form > from a db table. > > There''s also a way to do this with AJAX auto_complete > > http://slash7.com/articles/2005/8/13/ajaxariffic-autocomplete-with-sc... > > Hope this helps! > > Tyler > > On Jun 7, 5:07 pm, anitawa <anit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thanks... > > i got the select option set up...but how would i get data from > > diffrerent tables depending on user''s choice? > > > On Jun 7, 2:24 pm, "Cyril Mougel" <cyril.mou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On 6/7/07, anitawa <anit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > > > I want to create a select form and based on what the user chooses on > > > > the select form, I want to connect to different tables and display the > > > > content. > > > > > I''m clueless on how to go about it. > > > > Any pointers would be appreciated. > > > > The select helper is your friend > > > >http://api.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelp... > > > > -- > > Cyril Mougel--~--~---------~--~----~------------~-------~--~----~ 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 6/8/07, anitawa <anitawa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Thanks...i dont think i was clear > > im not looking to populate the select form from db table. > im looking to get data off different db tables depending on the choice > that the user makes from the select form. >You can get from different Table of you page form. If you want create a User and in this page, you have a link to School. You can made a select for all school that you have with <%= select :school, school_id, School.find(:all).collect {|s| [ s.name, s.id ] } %> After you have the school_id good for creation and when you made the creation, you have link to School. Else, you can define the param as you want and use it like an other params. -- Cyril Mougel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, if I understand correctly -- the visitor''s selection will be available for you in params hash in your controller. In the controller you can have some case...when logic, accessing different models = different DB tables. Is this what you are looking for? Karel On Jun 8, 1:15 am, anitawa <anit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks...i dont think i was clear > > im not looking to populate the select form from db table. > im looking to get data off different db tables depending on the choice > that the user makes from the select form. > > On Jun 7, 4:13 pm, "tyler.a.montgom...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" > > <tyler.a.montgom...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi there, > > I''m not sure if this is exactly what you want but it got me going down > > the right path a while ago: > > >http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=5 > > > This will walk you through getting specific data into the select form > > from a db table. > > > There''s also a way to do this with AJAX auto_complete > > >http://slash7.com/articles/2005/8/13/ajaxariffic-autocomplete-with-sc... > > > Hope this helps! > > > Tyler > > > On Jun 7, 5:07 pm, anitawa <anit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Thanks... > > > i got the select option set up...but how would i get data from > > > diffrerent tables depending on user''s choice? > > > > On Jun 7, 2:24 pm, "Cyril Mougel" <cyril.mou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On 6/7/07, anitawa <anit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Hi, > > > > > > I want to create a select form and based on what the user chooses on > > > > > the select form, I want to connect to different tables and display the > > > > > content. > > > > > > I''m clueless on how to go about it. > > > > > Any pointers would be appreciated. > > > > > The select helper is your friend > > > > >http://api.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelp... > > > > > -- > > > Cyril Mougel--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---