I have a problem. There is a form in which you need to pass two values and two object (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 %>
Trying to pass through objects hidden Fields. But they are passed in this form
<input id="score_team1" name="score[team1]" type="hidden" value="#<Team:0x00000002db46b8>" />
<input id="score_team2" name="score[team2]" type="hidden" value="#<Team:0x00000003335380>" />
How to pass an object through a form_for rails?