I need some general help with radio buttons. Here is what I want to do: I need two radio buttons which correspond to a tinyint column in the DB. I want the radio buttons to be pre-selected to the DB value. When a user changes the selection, I want the changes reflected in the DB without clicking on any buttons. I have found in_place_control plugin but can''t figure out how to use it/install it. I can create the buttons - but they are not pre-selected and I am not sure how to do the update. Help is much appreciated - code examples are great. I have the books and have read the api - so if that is your advice don''t bother. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
augustlilleaas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-20 13:35 UTC
Re: Help with radio buttons
If you use the check_box helper, the default value (set in the database itself) should be selected on new records, and the actual value if it''s an existing record. On Jan 20, 2:10 am, "Kim" <Kim.Gri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I need some general help with radio buttons. Here is what I want to do: > > I need two radio buttons which correspond to a tinyint column in the > DB. I want the radio buttons to be pre-selected to the DB value. When a > user changes the selection, I want the changes reflected in the DB > without clicking on any buttons. > > I have found in_place_control plugin but can''t figure out how to use > it/install it. I can create the buttons - but they are not pre-selected > and I am not sure how to do the update. > > Help is much appreciated - code examples are great. I have the books > and have read the api - so if that is your advice don''t bother.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
OK - but when a user makes a selection I want the value reflected in the DB with out forcing the user to then click a button. I have read up on observe field - but my understanding is that it does not work with radio buttons. Any suggestions? Thanks, K On Jan 20, 5:35 am, "augustlille...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <augustlille...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you use the check_box helper, the default value (set in the database > itself) should be selected on new records, and the actual value if it''s > an existing record. > > On Jan 20, 2:10 am, "Kim" <Kim.Gri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I need some general help with radio buttons. Here is what I want to do: > > > I need two radio buttons which correspond to a tinyint column in the > > DB. I want the radio buttons to be pre-selected to the DB value. When a > > user changes the selection, I want the changes reflected in the DB > > without clicking on any buttons. > > > I have found in_place_control plugin but can''t figure out how to use > > it/install it. I can create the buttons - but they are not pre-selected > > and I am not sure how to do the update. > > > Help is much appreciated - code examples are great. I have the books > > and have read the api - so if that is your advice don''t bother.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Kim wrote:> OK - but when a user makes a selection I want the value reflected in > the DB with out forcing the user to then click a button. I have read up > on observe field - but my understanding is that it does not work with > radio buttons. Any suggestions? > > Thanks, K > > On Jan 20, 5:35 am, "augustlille...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" > <augustlille...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > If you use the check_box helper, the default value (set in the database > > itself) should be selected on new records, and the actual value if it''s > > an existing record. > > > > On Jan 20, 2:10 am, "Kim" <Kim.Gri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I need some general help with radio buttons. Here is what I want to do: > > > > > I need two radio buttons which correspond to a tinyint column in the > > > DB. I want the radio buttons to be pre-selected to the DB value. When a > > > user changes the selection, I want the changes reflected in the DB > > > without clicking on any buttons. > > > > > I have found in_place_control plugin but can''t figure out how to use > > > it/install it. I can create the buttons - but they are not pre-selected > > > and I am not sure how to do the update. > > > > > Help is much appreciated - code examples are great. I have the books > > > and have read the api - so if that is your advice don''t bother.Add on ''onClick'' helper that fires off a remote_function call that updates the database. _Kevin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---