Combination of fields_for block and non fields_for block in Rails 3.2 -


i'm trying create form combination of fields_for block , non fields_for block:

but outputs repeating, , looks they're looping...

maybe because, there fields_for block , other 1 not fields_for / form.

how can combine 2 of them inside <tbody> or <tr> tag.

<% @annual_procurement_plan.project_procurement_management_plans.each |ppmp| %>     <% ppmp.items.each |itemx| %>     <tbody>         <%= f.fields_for :project_procurement_management_plans |p| %>           <%= p.fields_for :items |item| %>                 <tr class="nested-fields info">                 <td>                <%= item.select :category_id, category.all.map{|c| [c.code, c.id]}%>                </td>                                              <td>                        <%= content_tag :span, itemx.description%>                      </td>                     <td><%= p.text_field :pmo_end_user%>                      </td>          </tr>        <% end %>         <% end %>      </tbody>    <% end %> <% end %> 

any workarounds appreciated. thank you.

place iteration item in fields_for this

f.fields_for :project_procurement_management_plans, ppmp |p| 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -