using if statements in View

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 = "--"%>
    <tr class="vgood">
  <% elsif widget.flag = "++" || widget.second_flag = "++"%>
    <tr class="bad">
  <% elsif widget.flag = "--" || widget.second_flag = "--"%>
    <tr class="good">
  <%else%>
    <tr class="d<%= cycle("0", "1") %>">
  <%end%>

If anyone has any advice, I would be very appreciative.

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 = "--"%>
<tr class="vgood">

Check your ruby: = is the assignment operator, == is the comparison
operator. You'd probably find this all flowed more naturally if you
wrapped this up in a view helper.

Fred