title: radio button ruby on rails
body: <p>I was wondering if there is a way to use radio button to set the value of a field that is a text box.</p>
  
  <pre><code>    &lt;%= radio_button("demographics_questionaires", "gender", "Male")%&gt; Male &lt;br\&gt;
      &lt;%= radio_button("demographics_questionaires", "gender", "Female")%&gt; Female &lt;&lt;br\&gt;
      &lt;%= radio_button("demographics_questionaires", "gender", "Other")%&gt; 
      Other &lt;%= f.text_field gender %&gt; 
  </code></pre>
  
  <p>Above code is incorrect, but something on that lines.</p>
  
  <p>If the other radio button is selected, I want gender to be set to the value of the text_field?  Not sure how you do that association?               </p>
  
  <p>Ex.</p>
  
  <p>[radio button] Male</p>
  
  <p>[radio button] Female</p>
  
  <p>[radio button] Other  __________________</p>
  
  <p>where ____________ is the text box to enter.</p>
  
  <p>In the end If the user choose male, I want the value the is stored in the database to be "Male", for female "FEMALE", or for other what the user inputs.</p>
  
  <p>I kind of wanted to handle all the logic in the view.  Is that possible or does it have to be done in the controller?</p>
  
  <p>Any advice appreciated,</p>