我有个问题。有一种形式,需要传入两个值和两个对象(teamh,teamq)。
<%= form_for (Score.new) do |f| %>
<p>
<%= f.hidden_field :team1, value: teamh %>
<%= f.hidden_field :team2, value: teamq %>
<%= f.text_field :team1_score %>
<%= f.text_field :team2_score %>
</p>
<p><%= f.submit "Submit" %></p>
<% end %>
试图通过对象隐藏字段。但是它们以这种形式传递
<input id="score_team1" name="score[team1]" type="hidden" value="#<Team:0x00000002db46b8>" />
<input id="score_team2" name="score[team2]" type="hidden" value="#<Team:0x00000003335380>" />
如何通过 form_for rails 传递对象?