Hi out there. I am trying to create a table that displays
information, and then changes the class of the row if a flag is
presented, but can’t determine if putting it in the view is the best
method for doing so or not. Right now, I have tried this in my view,
but it currently sets the columns to whichever is set into the if
statements first.
<% for widget in @widgets %>
<% if widget.flag = “–” && widget.second_flag = “–”%>
<% elsif widget.flag = “++” || widget.second_flag = “++”%>
<% elsif widget.flag = “–” || widget.second_flag = “–”%>
<%else%>
<tr class=“d<%= cycle(“0”, “1”) %>”>
<%end%>
If anyone has any advice, I would be very appreciative.