我正在寻找一个两次嵌套属性表单的解决方案。球队有几个球员,每个球员都有几轮。我在模型中添加了 accept_nested_attributes。这种方式对我不起作用。
<% form_for(@team) do |team_fields| %>
...SOME FIELDS...
<% team_fields.fields_for :players do |player_fields| %>...SOME FIELDS...
<% player_fields.fields_for :rounds do |round_fields| %>
<%= round_fields.text_field :message%>
<%end%>
<%end%>
<%end%>