Forum: Ruby on Rails radio buttons => What if the value is a FK?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
39025a7f572d6fe464e1fe6be399ca3b?d=identicon&s=25 Mike Dershowitz (mdersh53)
on 2007-01-31 22:17

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<br />
<%= radio_button :goals, :goaltype_id, 'One-time', { :onclick => "new
Effect.SlideDown('onetime'); return false;" }  %>&nbsp;&nbsp;One-time<br
<%= radio_button :goals, :goaltype_id, 'Compound', { :onclick => "new
Effect.SlideDown('compound'); return false;" }
%>&nbsp;&nbsp;Compound<br />
<%= radio_button :goals, :goaltype_id, 'Elapsed', { :onclick => "new
Effect.SlideDown('elapsed'); return false;" }  %>&nbsp;&nbsp;Elapsed<br

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.

This topic is locked and can not be replied to.