samedi 28 décembre 2019

unable to print the status if neither true nor false in rails

Hi i have i model name ProjectSite and a model name ManagerReamark which takes a decision boolean value. ProjectSite has many ManageRemark. default value of decision is nil. how can i print status as pending when there is no ManagerRemark? here is code

                <% project_site.manager_remarks.each do |manager_remark| %>
              <% if manager_remark.decision == false %>
                <td><%= 'Rejected' %></td>
              <% elsif manager_remark.decision == true %>
                <td><%= "Approved" %></td>
              <% else %>
                <td><%= "Pending" %></td>
              <% end %>
           <% end %>

Aucun commentaire:

Enregistrer un commentaire