0

I have a table in a partial _measures_findings_list.html.erb where I want to replace the table row with another partial, which I can reuse elsewhere. MeasuresFinding is a model, so I first created a partial _measures_finding.html.erb, and tried:

<% render @measures_findings %>

then I tried

<% @measures_findings.each do |measures_finding| %>
  <% render 'measures_finding', measures_finding: measures_finding %>  
<% end %>

Nothing. Then

<% @measures_findings.each do |measures_finding| %>
  <% render 'measures_finding/measures_finding', measures_finding: measures_finding %>  
<% end %>

What am I doing wrong? Putting the code of the partial into the each loop works of course.

4

1 回答 1

1

你错过'=',它应该是

<%= render @measures_findings %>
于 2013-07-12T09:54:30.227 回答