Reading oracle data type char in radio_button


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

<%= radio_button ('attending_ip', :problem_1_status, '1') %>
Urgent&nbsp &nbsp
<%= radio_button ('attending_ip', :problem_1_status, '2')%>Active&nbsp
<%= radio_button ('attending_ip', :problem_1_status, '3')
%>Stable&nbsp &nbsp
<%= radio_button ('attending_ip', :problem_1_status, '4') %>Resolved</


problem_1_status -> char


I used console to check what is being for a specific record and I
found the problem. Somehow, it was returning empty space.

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.