<% entry.components['values'].each do |component| %> <%== render(:partial => 'component_value', :locals => {:result => component[:result]} ) %> <% if (component['referenceRangeHigh'] && !component['referenceRangeHigh']['scalar'].to_s.empty?) || (component['referenceRangeLow'] && !component['referenceRangeLow']['scalar'].to_s.empty?) %> <% if component['referenceRangeLow'] %> unit="<%= component['referenceRangeLow']['units'] %>"<% else -%>unit="1"<% end -%>/> <% end %> <% if component['referenceRangeHigh'] %> unit="<%= component['referenceRangeHigh']['units'] %>"<% else -%>unit="1"<% end -%>/> <% end %> <% end %> <% end %>