简单形式:分组嵌套输入

时间:2014-08-11 13:28:42

标签: ruby-on-rails ruby-on-rails-4 simple-form

在我的应用程序中,我为简单表单嵌套资源:

<%= simple_form_for @member, url: "/assessments/update_invite/#{@token}", method: :post do |f| %>
  <%= f.simple_fields_for :assessment_procedure_results do |g| %>
    <%= g.object.skill.skill_group.name %>
    <%= g.input :self_estimation %>
    <%= g.input :skill_id, as: :hidden %>
    <%= g.input :assessment_procedure_member_id, as: :hidden %>
  <% end %>
  <%= f.button :submit%>
<% end %>

用我的代码:

**Skill group 1**
Programming <input here>

**Skill group 1**
Testing <input here>

**Skill group 1**
Designing <input here>

如何按SkillGroup分组字段,如:

**Skill group 1**
Programming <input here>
Testing <input here>
Designing <input here>

谢谢!

0 个答案:

没有答案