# Fields\_for and radio button problem

**URL:** <https://www.ruby-forum.com/t/fields-for-and-radio-button-problem/179711>\
**Category:** Rails\
**Created:** [December 2, 2009, 1:14pm UTC](https://www.ruby-forum.com/t/fields-for-and-radio-button-problem/179711 "2009-12-02T13:14:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![seamus\_rooney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9e5f3/32.png) [@seamus\_rooney](https://www.ruby-forum.com/u/seamus_rooney)\
**Post date:** [December 2, 2009, 1:14pm UTC](https://www.ruby-forum.com/t/fields-for-and-radio-button-problem/179711/1 "2009-12-02T13:14:19Z")

</div>

Hi,

I have a dynamic list I generate based on record I have in a table. What  
I am trying to do is have a radio button at the end of each line so I  
can select it and delete the record this applies to and to do this I  
need the value dynamically set based on the record id in the table. I  
have tried the following and variations of it but I have had no success.

I’m fairly new to ruby so still learning the ins and outs. Can anyone  
suggest where I am going wrong with this please?

My code is the following:

\<% f.fields\_for :academic\_qualifications, @academic\_qualifications do  
|form| %\>

  
\<%=@index%\>  
  
\<%= form.select :hetac,  
AcademicQualification::HETAC,{:include\_blank =\>  
true},:class=\>“facultyselect”%\>  
  
  
\<%= form.text\_field :award, :class=\>“code” %\>  
   
\<%= form.date\_select(:year, :discard\_month=\>true,:discard\_day  
=\> true, :start\_year =\> 2010, :end\_year =\> 1920, :include\_blank =\> true)  
%\>  
  
  
  
  
  
\<% @index=@index+1 %\>

Thanks in advance for any help,

Seamus
