…hey guys, here is the view code in question…
<td>
<%= f.radio_button :score, '4' %>
</td>
…and my model has… attr_accessible :rating_id, :score, :student_id
As you can see I am assigning a score to the radio button. I also have a ‘rating_id’ attribute on this model, which would also like to assign to this radio button. So ideally I would like something like…
<%= f.radio_button :score => '4', :rating_id => '234' %>
…of course this doesn’t work, but you get the picture. Any ideas on how I can accomplish this???
So I ended up solving this by doing…
The key for me was finding the syntax to set the value of a hidden field ‘on the fly’ rather than it being set in my controller.