I have a question. I'vesentthetableI'vealreadydone,butIhaveaproblem,inthecaseof"Isolate's name" "catx"
I have two "gene's name" associado, "catxx" e o "catxxx"
, but I'm putting both in the same line and I would like to duplicate the line, one for "catxx" and one for the "catxxx". How can I, I can not find the solution. The code I have is:
<tbody>
<% if @resists.any? == true%>
<% @resists.each do |resist| %>
<tr>
<td><%= resist.isolated.organism.tax_org if resist.isolated%>
<td><%= resist.isolated.organism.name if resist.isolated%>
<td><%= resist.isolated.name if resist.isolated%>
<td><%= resist.isolated.disease if resist.isolated%>
<td><%= resist.drug.name%>
<td><%= resist.drug.reference%>
<td><%= resist.drug.atc%>
<td><%if resist.isolated %>
<% @genes.each do |gene| %>
<%if resist.isolated.id == gene.isolated_id%>
<%= gene.name%>
<%end%>
<%end%>
<%end%>
</td>
@genes, go get the genes all.
I'm doing
<% @genes.each do |gene| %>
<%if resist.isolated.id == gene.isolated_id%>
<%= gene.name%>
<%end%>
<%end%>
Because an isolate can have multiple genes, and as such, if you do resist.isolated.gene.name it will give me error because it has more than one. But as I am doing it puts me in the same line the genes all of that isolate and I wanted to put each gene in a different line, duplicating the isolate, of course. For example:
123 xpto catx cenas12 navnav 2111 catxx
123 xpto catx cenas12 navnav 2111 catxxx