Hi,
I have hierarchical "if loops" like this
<% @descriptions.each_with_index do |description, i| %> <% description.tale2.each do |tax_ref| %>
<% if condition %>
<% if condition %> <% if condition %>
<%= $text_first_describe%> <%= $paren_author_yr %> <% ref_sp_uniq.each_with_index do |ref, i| %> <% if ref == tax_ref.ref_wo_brace%> <% execution %>
<% elsif i == (ref_sp_uniq.size - 1)%> <%# @ref_desc = "#{@ref_desc_numb}. #{tax_ref.ref_wo_brace}" %> <% end %> <% end %> <% if condition %> <% execution %>
<% elsif condition %> <% execution %> <% elsif taxon_name.emend_author_year %>
<%= print %> <% else %>
<%= print %>
<% end %> <% end %> <% else %> <% if condition %> <%= print %> <% ref_sp_uniq.each_with_index do |ref, i| %> <% if condition %> <% execution %>
<% elsif condition %> <% execution %>
<% end %> <% end %> <% if condition %> <% execution %>
<% elsif condition %> <% execution %>
<% elsif condition %> <% execution %>
<% else %> <% execution %>
<% end %> <% end %> <% end %> <% end %> <% end %>
<% end %>
Kindly suggest me possible way to reduce this kind of junk "if loops".
No comments:
Post a Comment