I nned to get an associsted name from one table dependent on the related
id value in another table when rendering the view but cant figure out
the syntax to handle pontential empty values:-
i.e. docv.policy_id OR docv.standard_id will exist and therefore link
back to the policies OR the standards table respectively but ONLY ONE
Therefore I need to check the existance of each field before attempting
to get the PolicyName OR StandrdsName from the related table otherwise
the empty item gives me a ‘.nil value’ error.
<% @docversions.each do |docv| %>
Can someone advise the syntax to use in the view to achieve this. I have
also tried …“if !docv.standard_id.empty?”.