In your controller, do
@foo.bar_id = 3
or
@foo.bar = Bar.find(3)
On 3/22/06, Bob Boyken <bob@boyken.org> wrote:> I have:
>
> <%= radio_button ''foo'', ''bar_id'',
''1'' %>
> <%= radio_button ''foo'', ''bar_id'',
''2'' %>
> <%= radio_button ''foo'', ''bar_id'',
''3'' %>
>
> I would like to have option #3 be selected if foo.bar_id is nil. Is
> there a way to do that?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>