Hi, I am having problem when I read oracle char data type on edit form(after saving the form and go to edit page again, all the radio buttons are unchecked). text_field works fine for char data type. Is there any special way that I need to use for reading oracle char data type? <%= radio_button (''attending_ip'', :problem_1_status, ''1'') %> Urgent    <%= radio_button (''attending_ip'', :problem_1_status, ''2'')%>Active    <%= radio_button (''attending_ip'', :problem_1_status, ''3'') %>Stable    <%= radio_button (''attending_ip'', :problem_1_status, ''4'') %>Resolved</ FONT></FONT></TD> problem_1_status -> char thanks, --~--~---------~--~----~------------~-------~--~----~ 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 used console to check what is being for a specific record and I found the problem. Somehow, it was returning empty space. On Jan 23, 12:04 pm, kimda <ki...-yOgK34DqlZDxlngV0+vsch2eb7JE58TQ@public.gmane.org> wrote:> Hi, > > I am having problem when I read oracle char data type on edit > form(after saving the form and go to edit page again, all the radio > buttons are unchecked). text_field works fine for char data type. Is > there any special way that I need to use for reading oracle char data > type? > > <%= radio_button (''attending_ip'', :problem_1_status, ''1'') %> > Urgent    > <%= radio_button (''attending_ip'', :problem_1_status, ''2'')%>Active  >   > <%= radio_button (''attending_ip'', :problem_1_status, ''3'') > %>Stable    > <%= radio_button (''attending_ip'', :problem_1_status, ''4'') %>Resolved</ > FONT></FONT></TD> > > problem_1_status -> char > > thanks,--~--~---------~--~----~------------~-------~--~----~ 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 kimda, The CHAR data type in Oracle specifies a fixed-length character string. If inserting a value that is shorter than the column length, Oracle will fill the value with blanks. If the length of the column is 2 and you insert ''1'', the string "1 " will be stored, so the radio button generated by "<%radio_button (''attending_ip'', :problem_1_status, ''1'') %>" won''t be checked because ''1'' does not equal to ''1 ''. The VARCHAR data type doesn''t have this problem. 2008/1/24, kimda <kimda-yOgK34DqlZDxlngV0+vsch2eb7JE58TQ@public.gmane.org>:> > > I used console to check what is being for a specific record and I > found the problem. Somehow, it was returning empty space. > > On Jan 23, 12:04 pm, kimda <ki...-yOgK34DqlZDxlngV0+vsch2eb7JE58TQ@public.gmane.org> wrote: > > Hi, > > > > I am having problem when I read oracle char data type on edit > > form(after saving the form and go to edit page again, all the radio > > buttons are unchecked). text_field works fine for char data type. Is > > there any special way that I need to use for reading oracle char data > > type? > > > > <%= radio_button (''attending_ip'', :problem_1_status, ''1'') %> > > Urgent    > > <%= radio_button (''attending_ip'', :problem_1_status, ''2'')%>Active  > >   > > <%= radio_button (''attending_ip'', :problem_1_status, ''3'') > > %>Stable    > > <%= radio_button (''attending_ip'', :problem_1_status, ''4'') %>Resolved</ > > FONT></FONT></TD> > > > > problem_1_status -> char > > > > thanks, > > >-- Regards, Jesse --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---