From e3dd4baefeab82dd2568b4b7f3af4a5430678a61 Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 17 Jun 2013 13:37:16 +0200 Subject: prevent conversion of nil for neighbors --- views/neighbors.haml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'views/neighbors.haml') 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 -- cgit v1.2.3