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