I am trying to write a method in my show.html.erb page that has two boolean conditions to the first if condition.
I have:
<% if @project.requires_educator_approval && @project.educator_approved == false %>
<p>Approved</p>
<% elsif @project.requires_educator_approval && @project.approval_requested && @project.educator_approved == false %>
<p>Approval requested</p>
<% elsif @project.requires_educator_approval && @project.approval_requested == false %>
<p>Approval request pending</p>
<% elsif @project.requires_educator_approval == false %>
<p>No approval required</p>
<% else %>
<p>TBC</p>
<% end %>
I think the above isn't correct, but I'm stuck for fresh ideas as to how to approach it.
I have boolean attributes in my database for each of these conditions (so I think I can use the ? to check if it's true, but is there a !? to check if it's not true?)
Does anyone have better ideas about how to go about this?
Thanks very much.