title: How to make a radio button store a boolean?
body: <p>I have a form with the following code to store a boolean. isteacher is a boolean in the db. I'm trying to set this up so that on a sign up form a user would check the radio button for either student or teacher which I would check for in the controller with <code>if @user.isteacher = true</code></p>
  
  <pre><code>  &lt;div&gt;&lt;%= label :isteacher, "Teacher" %&gt;
    &lt;%= f.radio_button :isteacher, true, :checked =&gt; true , :value =&gt; true %&gt;&lt;/div&gt;
  
    &lt;div&gt;&lt;%= label :isteacher, "Student"%&gt;
    &lt;%= f.radio_button :isteacher, false, :value =&gt; false %&gt;&lt;/div&gt;
  </code></pre>
  
  <p>In the schema the boolean looks like this: <code>t.boolean  "isteacher", default: false, null: false</code></p>
  
  <p><strong>Issue</strong></p>
  
  <p>When a new user is created and the Teacher radio button is selected, db always reflects student. If I try to edit the registration, the data is saved but each time I return to the form the student radio button is selected. Any ideas?</p>