how to workout with option buttons

I need a form development with the following requirements..

I have the employee form he has a dependent or may not so i took the
option buttons yes/no based on that the data to be stored in the
database either 'y'/'n'.
i wrote the java script event for the onclick event of the buttons(YES
and NO)
in that i am not getting how to set the field to the @employee.dependent
in the controller if i do @employee.dependent='y' it is working fine
before the

i need that action according to the option buttons in the _form.rhtml..
i tried by creating the class variable @depend it is declared in my
model in the employee class and is accessed form the .rhtml <%=
@employee.depend='y' %>
but it is not working..

or even i tried with the instance variable @depend in my controller and
in the .rhtml i tried as <%= @depend='y' %>
i wrote the line @employee.dependent = @depend before the statement
even it is also not working can anyone help me regarding this..