# Radio buttons =\> What if the value is a FK?

**URL:** <https://www.ruby-forum.com/t/radio-buttons-what-if-the-value-is-a-fk/84058>\
**Category:** Rails\
**Created:** [January 31, 2007, 10:17pm UTC](https://www.ruby-forum.com/t/radio-buttons-what-if-the-value-is-a-fk/84058 "2007-01-31T22:17:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![miked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@miked](https://www.ruby-forum.com/u/miked)\
**Post date:** [January 31, 2007, 10:17pm UTC](https://www.ruby-forum.com/t/radio-buttons-what-if-the-value-is-a-fk/84058/1 "2007-01-31T22:17:14Z")

</div>

Hi:

I have radio buttons like this in my view:

\<%= radio\_button :goals, :goaltype\_id, ‘Recurring’, { :onclick =\> “new  
Effect.SlideDown(‘recurring’); return false;” }  
%\>&nbsp;&nbsp;Recurring  
  
\<%= radio\_button :goals, :goaltype\_id, ‘One-time’, { :onclick =\> “new  
Effect.SlideDown(‘onetime’); return false;” } %\>&nbsp;&nbsp;One-time  
\<%= radio\_button :goals, :goaltype\_id, ‘Compound’, { :onclick =\> “new  
Effect.SlideDown(‘compound’); return false;” }  
%\>&nbsp;&nbsp;Compound  
  
\<%= radio\_button :goals, :goaltype\_id, ‘Elapsed’, { :onclick =\> “new  
Effect.SlideDown(‘elapsed’); return false;” } %\>&nbsp;&nbsp;Elapsed

Everything is working fine. My problem is that the value of “One-time”  
etc., isn’t really the value back to the object of “goal”, but instead  
it’s actually a FK to another table, where “one-time” corresponds to  
“goaltype\_id” numeric in the table goal.

My problem is that the the value of the “goaltype\_id” isn’t being  
comitted back to the table with the goal. How would I make this work?

Thanks very much in advance for your time.

Mike
