summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2013-06-17 13:37:16 +0200
committergebele <gebele@in-silico.ch>2013-06-17 13:37:16 +0200
commite3dd4baefeab82dd2568b4b7f3af4a5430678a61 (patch)
treead310f494e5cf38c8ac4b49f9371cf1f1115295d
parent3bb0ba2c96572ff6b77a8a879fa1f3cd45ae000c (diff)
prevent conversion of nil for neighbors
-rw-r--r--views/neighbors.haml9
1 files changed, 5 insertions, 4 deletions
diff --git a/views/neighbors.haml b/views/neighbors.haml
index ddea418..43fb397 100644
--- a/views/neighbors.haml
+++ b/views/neighbors.haml
@@ -10,7 +10,6 @@
containment: ".content"
});
});
-
.results{:style=>"display:none"}
- count_m = 0
/ tabs div ;
@@ -85,15 +84,17 @@
Details
-#%tbody
- count = 0
+ / prevent conversion of nil
+ - c = p.data_entries[count][2] != nil ? p.data_entries[count][2] : ''
- p.compounds.each do |neighbor_compound|
%tr
%td.compound
%img{:src=>"#{neighbor_compound.uri}/image", :alt=>"", :width=>"100px"}
- %td{:class => "c"+p.data_entries[count][2]}
+ %td{:class => "c"+c}
= p.data_entries[count][2]
- %td{:class => "c"+p.data_entries[count][2]}
+ %td{:class => "c"+c}
= p.data_entries[count][3] != nil ? p.data_entries[count][3].round(3) : "No prediction result"
- %td{:class => "c"+p.data_entries[count][2]}
+ %td{:class => "c"+c}
%a{:href => to("/prediction/#{CGI.escape(neighbor_compound.uri)}/details"), :id=>"link#{count_rs}#{count}", :target=>"details"}
%img{:src=>"/images/arrow_right_float.png", :alt=>"arrow"}
:javascript